Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the repo to have 1 action #2

Merged
merged 57 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2c84883
initial commit
yairsimantov20 Feb 19, 2024
16c1e96
initial commit
yairsimantov20 Feb 19, 2024
f3d4294
updated test file
yairsimantov20 Feb 20, 2024
6a6db59
Merge remote-tracking branch 'origin/create-ocean-github-action' into…
yairsimantov20 Feb 20, 2024
22287ab
updated test file
yairsimantov20 Feb 20, 2024
29711c5
updated test file
yairsimantov20 Feb 20, 2024
e6860b6
updated test file
yairsimantov20 Feb 20, 2024
2d79657
updated test file
yairsimantov20 Feb 20, 2024
a25e544
checking .env file
yairsimantov20 Feb 20, 2024
38ac09e
checking .env file
yairsimantov20 Feb 20, 2024
9f1fd5c
checking .env file
yairsimantov20 Feb 20, 2024
a8b40b2
checking .env file
yairsimantov20 Feb 20, 2024
8b42663
checking .env file
yairsimantov20 Feb 20, 2024
c6be02d
checking .env file
yairsimantov20 Feb 20, 2024
062fc1d
checking .env file
yairsimantov20 Feb 20, 2024
d9d7b40
checking .env file
yairsimantov20 Feb 20, 2024
a7e3440
checking .env file
yairsimantov20 Feb 20, 2024
5b0e039
checking .env file
yairsimantov20 Feb 20, 2024
8938790
checking .env file
yairsimantov20 Feb 20, 2024
6b28805
checking .env file
yairsimantov20 Feb 20, 2024
7c8e8f1
checking .env file
yairsimantov20 Feb 20, 2024
6c00c39
checking .env file
yairsimantov20 Feb 20, 2024
5fecbf3
checking .env file
yairsimantov20 Feb 20, 2024
33137dd
checking .env file
yairsimantov20 Feb 20, 2024
69fccd4
checking .env file
yairsimantov20 Feb 20, 2024
de753d2
checking .env file
yairsimantov20 Feb 20, 2024
bdafacc
checking .env file
yairsimantov20 Feb 20, 2024
fab1c18
checking .env file
yairsimantov20 Feb 20, 2024
41d9acc
checking .env file
yairsimantov20 Feb 20, 2024
15fe8fb
checking .env file
yairsimantov20 Feb 20, 2024
085a8da
checking .env file
yairsimantov20 Feb 20, 2024
54b3810
checking .env file
yairsimantov20 Feb 20, 2024
44d8edf
checking .env file
yairsimantov20 Feb 20, 2024
e9d4e67
checking .env file
yairsimantov20 Feb 20, 2024
b760aca
checking .env file
yairsimantov20 Feb 20, 2024
bc3170e
added secrets
yairsimantov20 Feb 20, 2024
2b4922d
added secrets
yairsimantov20 Feb 20, 2024
56bfa59
readme
yairsimantov20 Feb 20, 2024
55fadb9
readme
yairsimantov20 Feb 20, 2024
f13a04f
readme
yairsimantov20 Feb 20, 2024
3f85388
Update .github/workflows/test.yml
yairsimantov20 Feb 20, 2024
632b312
naming
yairsimantov20 Feb 20, 2024
6491cc9
Update README.md
yairsimantov20 Feb 20, 2024
4461abd
Update sail/README.md
yairsimantov20 Feb 20, 2024
1628252
Update sail/action.yml
yairsimantov20 Feb 20, 2024
e9ef5d3
cr
yairsimantov20 Feb 20, 2024
16ee040
Merge remote-tracking branch 'origin/create-ocean-github-action' into…
yairsimantov20 Feb 20, 2024
9e69a38
cr
yairsimantov20 Feb 20, 2024
7d2aadc
cr
yairsimantov20 Feb 20, 2024
e97a47e
cr
yairsimantov20 Feb 20, 2024
354b1e6
whitespace
yairsimantov20 Feb 20, 2024
64d7fa9
updated the action to have 1 action in the repo
yairsimantov20 Feb 21, 2024
6790f5c
updated the readme
yairsimantov20 Feb 21, 2024
4eaed38
Merge remote-tracking branch 'origin/main' into create-ocean-github-a…
yairsimantov20 Feb 21, 2024
22f60b8
changed .env file name
yairsimantov20 Feb 21, 2024
935bf19
removed sail folder
yairsimantov20 Feb 21, 2024
fd4c945
updated pr
yairsimantov20 Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: ./sail
- uses: .
with:
type: 'jira'
port_client_id: ${{ secrets.PORT_CLIENT_ID }}
Expand Down
61 changes: 52 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,61 @@
<!-- action-docs-header action="action.yml" -->

<!-- action-docs-header action="action.yml" -->

<img align="right" width="100" height="74" src="https://user-images.githubusercontent.com/8277210/183290025-d7b24277-dfb4-4ce1-bece-7fe0ecd5efd4.svg" />

# 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/)
<!-- action-docs-description action="action.yml" -->
## 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
<!-- action-docs-description action="action.yml" -->

# 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/)

<!-- action-docs-inputs action="action.yml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `type` | <p>The type of the integration to run</p> | `true` | `""` |
| `identifier` | <p>The identifier of the integration to run</p> | `false` | `""` |
| `port_client_id` | <p>The Port client id</p> | `true` | `""` |
| `port_client_secret` | <p>The Port client secret</p> | `true` | `""` |
| `initialize_port_resources` | <p>Should ocean try to create the default blueprints, pages &amp; integration config for the integration</p> | `false` | `true` |
| `config` | <p>The configuration for the integration</p> | `false` | `""` |
| `platform` | <p>The platform to run the integration on</p> | `false` | `linux/amd64` |
| `image` | <p>The image to run the integration from</p> | `false` | `""` |
| `version` | <p>The version of the integration to run</p> | `false` | `latest` |
<!-- action-docs-inputs action="action.yml" -->

<!-- action-docs-outputs action="action.yml" -->
## Outputs

| name | description |
| --- | --- |
| `exit_code` | <p>The exit code of the Ocean Sail command</p> |
<!-- action-docs-outputs action="action.yml" -->

## 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 }}
```
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Releases

### 1.0.0
- Initial release
- Initial release of the ocean sail action

18 changes: 9 additions & 9 deletions sail/action.yml → action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: rm .sail-env
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "ocean-github-action",
yairsimantov20 marked this conversation as resolved.
Show resolved Hide resolved
"version": "1.0.0",
"repository": "[email protected]:port-labs/ocean-github-action.git",
"repository": "[email protected]:port-labs/ocean-sail.git",
"author": "yair <[email protected]>",
"license": "Apache-2.0",
"dependencies": {
"action-docs": "^2.1.0"
},
"scripts": {
"ghadocs": "action-docs -u"
}
}
55 changes: 0 additions & 55 deletions sail/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions sail/package.json

This file was deleted.