From 5f902ea610c940150cd5dc4421ed9a305786e6c8 Mon Sep 17 00:00:00 2001 From: Yair Siman Tov <63305203+yairsimantov20@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:47:17 +0200 Subject: [PATCH] Updated the repo to have 1 action (#2) Co-authored-by: MatanHeledPort <115919235+MatanHeledPort@users.noreply.github.com> Co-authored-by: Mor Paz <1912.mor@gmail.com> --- .github/workflows/test.yml | 2 +- README.md | 61 +++++++++++++++++++++++++++++------ RELEASES.md | 2 +- sail/action.yml => action.yml | 18 +++++------ package.json | 5 ++- sail/README.md | 55 ------------------------------- sail/package.json | 9 ------ 7 files changed, 67 insertions(+), 85 deletions(-) rename sail/action.yml => action.yml (92%) delete mode 100644 sail/README.md delete mode 100644 sail/package.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 961d00b..9bb0433 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - uses: ./sail + - uses: . with: type: 'jira' port_client_id: ${{ secrets.PORT_CLIENT_ID }} diff --git a/README.md b/README.md index 55dce0f..0a49a37 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,61 @@ + + + + -# Ocean GitHub Action - by getPort.io +# Ocean Sail GitHub Action - by getPort.io [![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://www.getport.io/community) -Read more about the Ocean framework [here](https://ocean.getport.io/) + +## Description -All the possible Ocean integrations can be found at the [Ocean integrations library](https://ocean.getport.io/integrations-library/) +Runs the Ocean Sail command for a specific type of integration + -# Actions +The `sail` command is part of the Ocean framework and is used to run integrations. -This repository contains GitHub Actions for use with the Ocean framework. - -| Action | Description | -|--------------------------|----------------------------------------------------------------| -| [sail](./sail/README.md) | Runs the Ocean Sail command for a specific type of integration | +Read more about the Ocean framework [here](https://ocean.getport.io/) + +## Inputs + +| name | description | required | default | +| --- | --- | --- | --- | +| `type` |

The type of the integration to run

| `true` | `""` | +| `identifier` |

The identifier of the integration to run

| `false` | `""` | +| `port_client_id` |

The Port client id

| `true` | `""` | +| `port_client_secret` |

The Port client secret

| `true` | `""` | +| `initialize_port_resources` |

Should ocean try to create the default blueprints, pages & integration config for the integration

| `false` | `true` | +| `config` |

The configuration for the integration

| `false` | `""` | +| `platform` |

The platform to run the integration on

| `false` | `linux/amd64` | +| `image` |

The image to run the integration from

| `false` | `""` | +| `version` |

The version of the integration to run

| `false` | `latest` | + + + +## Outputs + +| name | description | +| --- | --- | +| `exit_code` |

The exit code of the Ocean Sail command

| + + +## Available integration types + +All available integration types are listed in the [Ocean integrations library](https://ocean.getport.io/integrations-library/) and can also be found in the data sources menu in the Port UI. + +## Example usage + +```yaml +- uses: port-labs/ocean-sail@v1 + with: + type: 'jira' + port_client_id: ${{ secrets.PORT_CLIENT_ID }} + port_client_secret: ${{ secrets.PORT_CLIENT_SECRET }} + config: | + jira_host: ${{ secrets.JIRA_HOST }} + atlassian_user_email: ${{ secrets.ATLASSIAN_USER_EMAIL }} + atlassian_user_token: ${{ secrets.ATLASSIAN_USER_TOKEN }} +``` \ No newline at end of file diff --git a/RELEASES.md b/RELEASES.md index 4ee168e..d78115f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,5 @@ # Releases ### 1.0.0 -- Initial release +- Initial release of the ocean sail action diff --git a/sail/action.yml b/action.yml similarity index 92% rename from sail/action.yml rename to action.yml index 52d06b9..67aecba 100644 --- a/sail/action.yml +++ b/action.yml @@ -59,31 +59,31 @@ runs: image_name="${{ inputs.image }}:${{ inputs.version }}" fi - echo "OCEAN__PORT__CLIENT_ID=${{ inputs.port_client_id }}" >> .env - echo "OCEAN__PORT__CLIENT_SECRET=${{ inputs.port_client_secret }}" >> .env + echo "OCEAN__PORT__CLIENT_ID=${{ inputs.port_client_id }}" >> .sail-env + echo "OCEAN__PORT__CLIENT_SECRET=${{ inputs.port_client_secret }}" >> .sail-env - echo "OCEAN__EVENT_LISTENER={\"type\":\"ONCE\"}" >> .env - echo "OCEAN__INITIALIZE_PORT_RESOURCES=${{ inputs.initialize_port_resources }}" >> .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 }}" >> .env + 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}" >> .env + echo "OCEAN__INTEGRATION__CONFIG__${upper_key}=${value}" >> .sail-env done fi - env >> .env + env >> .sail-env - docker run -i --rm --platform=${{ inputs.platform }} --env-file .env $image_name + docker run -i --rm --platform=${{ inputs.platform }} --env-file .sail-env $image_name echo "exit_code=$?" >> $GITHUB_ENV - name: 🧹 Cleanup if: always() shell: bash - run: rm .env \ No newline at end of file + run: rm .sail-env \ No newline at end of file diff --git a/package.json b/package.json index 1ad9050..685f7ae 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,13 @@ { "name": "ocean-github-action", "version": "1.0.0", - "repository": "git@github.com:port-labs/ocean-github-action.git", + "repository": "git@github.com:port-labs/ocean-sail.git", "author": "yair ", "license": "Apache-2.0", "dependencies": { "action-docs": "^2.1.0" }, + "scripts": { + "ghadocs": "action-docs -u" + } } diff --git a/sail/README.md b/sail/README.md deleted file mode 100644 index ef61408..0000000 --- a/sail/README.md +++ /dev/null @@ -1,55 +0,0 @@ - - - - - -## Description - -Runs the Ocean Sail command for a specific type of integration - - -The `sail` command is part of the Ocean framework and is used to run integrations. - -Read more about the Ocean framework [here](https://ocean.getport.io/) - - -## Inputs - -| name | description | required | default | -| --- | --- | --- | --- | -| `type` |

The type of the integration to run

| `true` | `""` | -| `identifier` |

The identifier of the integration to run

| `false` | `""` | -| `port_client_id` |

The Port client id

| `true` | `""` | -| `port_client_secret` |

The Port client secret

| `true` | `""` | -| `initialize_port_resources` |

Should ocean try to create the default blueprints, pages & integration config for the integration

| `false` | `true` | -| `config` |

The configuration for the integration

| `false` | `""` | -| `platform` |

The platform to run the integration on

| `false` | `linux/amd64` | -| `image` |

The image to run the integration from

| `false` | `""` | -| `version` |

The version of the integration to run

| `false` | `latest` | - - - -## Outputs - -| name | description | -| --- | --- | -| `exit_code` |

The exit code of the Ocean Sail command

| - - -## Available integration types - -All available integration types are listed in the [Ocean integrations library](https://ocean.getport.io/integrations-library/) and can also be found in the data sources menu in the Port UI. - -## Example usage - -```yaml -- uses: ocean-github-action/sail@v1 - with: - type: 'jira' - port_client_id: ${{ secrets.PORT_CLIENT_ID }} - port_client_secret: ${{ secrets.PORT_CLIENT_SECRET }} - config: | - jira_host: ${{ secrets.JIRA_HOST }} - atlassian_user_email: ${{ secrets.ATLASSIAN_USER_EMAIL }} - atlassian_user_token: ${{ secrets.ATLASSIAN_USER_TOKEN }} -``` \ No newline at end of file diff --git a/sail/package.json b/sail/package.json deleted file mode 100644 index af7d217..0000000 --- a/sail/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "ocean-github-action-sail", - "version": "1.0.0", - "repository": "git@github.com:port-labs/ocean-github-action.git", - "author": "yair ", - "scripts": { - "ghadocs": "action-docs -u" - } -}