Simple GitHub Action to build and upload a Coda Pack to Coda.
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/upload-pack.yml
You'll find a template repo with a working example here: coda-workflows/upload-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
.
It depends on the workflow you've adopted, but here's a simple usage:
Create a new branch matching the release/*
pattern, for example release/v1.0.0
.
Commit and push your changes to the new branch and it will trigger the action.
When pushing commits to a branch matching the release/*
pattern, the action will automatically build and upload a new version of the pack to Coda for you to test.
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 |
Name | Description |
---|---|
packVersion | The version of the uploaded pack. |
name: Upload Coda Pack
on:
push:
branches:
- release/*
jobs:
upload-coda-pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: siriusnottin/upload-coda-pack@v1
with:
codaApiToken: ${{ secrets.CODA_API_TOKEN }}
name: Upload Coda Pack
on:
push:
branches:
- release/*
jobs:
...
steps:
- uses: ...
with:
codApiToken: ${{ secrets.CODA_API_TOKEN }}
packPath: pack.ts
Feel free to contribute by opening an issue or submitting a pull request.
MIT License. See the LICENSE file for more information.