Skip to content

Commit

Permalink
chore: Update test.yml workflow to include Port base URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Shalev Avhar committed Jun 9, 2024
1 parent f318408 commit 7355f1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: test
on:
workflow_dispatch:


jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -15,7 +14,8 @@ jobs:
type: 'jira'
port_client_id: ${{ secrets.PORT_CLIENT_ID }}
port_client_secret: ${{ secrets.PORT_CLIENT_SECRET }}
port_base_url: https://app.getport.io
config: |
jira_host: ${{ secrets.JIRA_HOST }}
atlassian_user_email: ${{ secrets.JIRA_USER_EMAIL }}
atlassian_user_token: ${{ secrets.JIRA_USER_TOKEN }}
atlassian_user_token: ${{ secrets.JIRA_USER_TOKEN }}
20 changes: 12 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ inputs:
port_client_secret:
description: 'The Port client secret'
required: true
port_base_url:
description: 'The Port base URL'
required: false
initialize_port_resources:
description: 'Should Ocean try to create the default resources (blueprints, pages, integration config, etc.) provided with the integration'
required: false
Expand All @@ -41,7 +44,7 @@ outputs:
description: 'The exit code of the Ocean Sail command'
value: ${{ steps.ocean-sail.outputs.exit_code }}
runs:
using: "composite"
using: 'composite'
steps:
- name: ✅ Validate inputs
shell: bash
Expand All @@ -60,29 +63,30 @@ runs:
if [[ "${{ inputs.image }}" ]]; then
image_name="${{ inputs.image }}:${{ inputs.version }}"
fi
echo "OCEAN__PORT__CLIENT_ID=${{ inputs.port_client_id }}" >> .sail-env
echo "OCEAN__PORT__CLIENT_SECRET=${{ inputs.port_client_secret }}" >> .sail-env
echo "OCEAN__PORT__BASE_URL=${{ inputs.port_base_url }}" >> .sail-env
echo "OCEAN__EVENT_LISTENER={\"type\":\"ONCE\"}" >> .sail-env
echo "OCEAN__INITIALIZE_PORT_RESOURCES=${{ inputs.initialize_port_resources }}" >> .sail-env
if [[ "${{ inputs.identifier }}" ]]; then
echo "OCEAN__INTEGRATION__IDENTIFIER=${{ inputs.identifier }}" >> .sail-env
fi
if [[ "${{ inputs.config }}" ]]; then
for key in $(echo "${{ inputs.config }}" | yq eval "keys | .[]"); do
value=$(echo "${{ inputs.config }}" | yq eval ".$key")
upper_key=$(echo $key | tr '[:lower:]' '[:upper:]')
echo "OCEAN__INTEGRATION__CONFIG__${upper_key}=${value}" >> .sail-env
done
fi
env >> .sail-env
docker run -i --rm --platform=${{ inputs.platform }} --env-file .sail-env $image_name
echo "exit_code=$?" >> $GITHUB_ENV
- name: 🧹 Cleanup
Expand Down

0 comments on commit 7355f1a

Please sign in to comment.