-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marco Casula
committed
Apr 13, 2020
1 parent
934a624
commit 15c21cc
Showing
1 changed file
with
44 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,61 @@ | ||
:warning: This Github action is an unofficial and W.I.P. Paragon workflow invocator. | ||
This Github action is an unofficial [Paragon Workflow](https://www.useparagon.com/) invocator.<br /> | ||
Before you start using this action, consider that Paragon is currently in Beta, and breaking changes may occur at any time. | ||
|
||
This action will post into your Workflow endpoint the Github payload as is.<br /> | ||
You can send custom headers, adding those to the HTTP Request by specifying inputs. | ||
1. This action will post into your Workflow endpoint the Github payload as is. For more details, please review the [documentation](https://developer.github.com/v3/activity/events/types/). | ||
2. You can send custom headers, adding those to the HTTP Request by specifying `inputs`. | ||
3. By default, `eventName` parameter is added to the `querystring`. | ||
|
||
## Configure your Paragon Workflow | ||
## Configure Paragon Workflow | ||
The only requirement is to publish a workflow, exposing it via API Endpoint, waiting for "POST." <br /> | ||
This action expects the workflow to return a 200 OK response. | ||
|
||
|
||
## Configure your Github Action | ||
## Configure Github repository's settings | ||
The Workflow ID is retrived by the action from your Github secrets, using the environment vars. <br /> | ||
**Do not expose your Workflow ID at any moment**. | ||
|
||
1. Go to your repository's settings and click `Secrets` in the sidebar. | ||
2. Add a new secret and set the name to `PARAGON_WORKFLOW_ID`. | ||
2. Add a new secret and set the name to `PARAGON_WORKFLOW_ID`, they looks like `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`. | ||
3. Paste the copied **Endpoint ID from Paragon** into the `Value`. | ||
4. Click `Add secret`. | ||
|
||
## Configure Github repository's action | ||
|
||
### Basic Example | ||
|
||
The following example sends the payload to the configured Paragon on every push event. | ||
|
||
``` | ||
steps: | ||
- uses: kedoska/invoke-paragon-action@v1 | ||
env: | ||
PARAGON_WORKFLOW_ID: ${{ secrets.PARAGON_WORKFLOW_ID }} | ||
on: [push] | ||
jobs: | ||
hello_paragon: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Invoke Paragon Endpoint | ||
uses: kedoska/invoke-paragon-action@v1 | ||
env: | ||
PARAGON_WORKFLOW_ID: ${{ secrets.PARAGON_WORKFLOW_ID }} | ||
``` | ||
|
||
### Inputs as Headers | ||
To use request header parameters, sending values to Paragon as HTTP Headers, pass in an input matching the parameter name. | ||
### Add Headers Example | ||
|
||
The following example sends the payload of the configured Paragon on every release event, adding three extra parameters in the headers of your workflow.<br /> | ||
`Param1`, `Param2`, and `Param3` are sent to your endpoint, as standard HTTP `headers`.<br /> | ||
You can use these params to secure your endpoint as it is exposed to the Internet. | ||
|
||
``` | ||
steps: | ||
- uses: kedoska/invoke-paragon-action@v1 | ||
with: | ||
repository: ${{ github.repository }} | ||
status: "completed" | ||
env: | ||
PARAGON_WORKFLOW_ID: ${{ secrets.PARAGON_WORKFLOW_ID }} | ||
``` | ||
on: [push] | ||
jobs: | ||
hello_paragon: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Invoke Paragon Endpoint | ||
uses: kedoska/invoke-paragon-action@v1 | ||
with: | ||
param1: "first param" | ||
param2: "second static param" | ||
param3: ${{ github.repository }} | ||
env: | ||
PARAGON_WORKFLOW_ID: ${{ secrets.PARAGON_WORKFLOW_ID }} | ||
``` |