Simple GitHub Action to release a pack.
Create and copy your Coda API token from your account settings.
Add it as a secret to your repo with the name CODA_API_TOKEN
. (could be anything, but this is the default name used by the action)
I recommend you to generate a new token for your project, so you can easily revoke it if needed. Of course, you can also use your already existing personal token.
Here's how to add a secret to your repo using the GitHub CLI:
gh secret set CODA_API_TOKEN
See the GitHub documentation regarding secrets: Creating encrypted secrets for a repository
Add the action to your workflow file, for example .github/workflows/release-pack.yml
You'll find a template repo with a working example here: coda-workflows/release-pack.yml at main · siriusnottin/coda-workflows · GitHub
You'll need to pass the following parameters to the action:
codaApiToken
: The Coda API token you generated and added as a secret to your repo.packPath
(optional): The path to the pack file. Defaults topack.ts
.packVersion
(optional): The version of the pack. If not provided, coda will use the latest uploaded version.notes
: Release notes for the pack.
It depends on the workflow you've adopted, but here's a simple usage:
- Create a new branch from
main
(ormaster
) - Make your changes in the new branch
- Commit and push your changes to the new branch
- Merge your changes into
main
by creating a pull request
When the pull request is merged into main
, the action will be triggered and will release the pack to Coda.
Name | Description | Required | Default |
---|---|---|---|
codaApiToken | The Coda API token you generated and added as a secret to your repo. | true | |
packPath | The path to the pack file. | false | pack.ts |
packVersion | The version of the pack. If not provided, coda will use the latest uploaded version. | false | |
notes | Release notes for the pack. | true |
Name | Description |
---|---|
packReleaseVersion | The released version of the pack. |
name: Release Coda Pack
on:
pull_request:
branches:
- main
jobs:
release-coda-pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: siriusnottin/upload-coda-pack@v1
with:
codaApiToken: ${{ secrets.CODA_API_TOKEN }}
- uses: siriusnottin/release-coda-pack@v1
with:
codaApiToken: ${{ secrets.CODA_API_TOKEN }}
notes: ${{ github.event.pull_request.title }}
name: Release Coda Pack
on:
pull_request:
branches:
- main
jobs:
release-coda-pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: siriusnottin/upload-coda-pack@v1
with:
codaApiToken: ${{ secrets.CODA_API_TOKEN }}
- uses: siriusnottin/release-coda-pack@v1
with:
codaApiToken: ${{ secrets.CODA_API_TOKEN }}
packPath: pack.ts
packVersion: ${{ steps.upload-coda-pack.outputs.packVersion }}
notes: ${{ github.event.pull_request.title }}
Feel free to contribute by opening an issue or submitting a pull request.
MIT License. See the LICENSE file for more information.