Skip to content

Commit

Permalink
chore: Update test.yml workflow to include Port base URL (#4)
Browse files Browse the repository at this point in the history
Add port base_url to image

---------

Co-authored-by: Shalev Avhar <[email protected]>
  • Loading branch information
shalev007 and Shalev Avhar authored Jun 9, 2024
1 parent f318408 commit 56f44a0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 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 }}
4 changes: 4 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Releases

### 1.0.0

- Initial release of the ocean sail action

### 1.1.0

- Add support for the `port base_url` configuration option
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ocean-sail",
"version": "1.0.0",
"version": "1.1.0",
"repository": "[email protected]:port-labs/ocean-sail.git",
"author": "yair <[email protected]>",
"license": "Apache-2.0",
Expand Down

0 comments on commit 56f44a0

Please sign in to comment.