Feedback on passing Coda API key as a command line argument when running `coda upload` command

Hi @Mohammad_Mohammad2 - Thanks for kicking off this discussion. I’ve had people mention to me that they wanted to set up a GitHub action before, but I hadn’t had time to look into it to date. I agree that it would be nice to have a parameter for the token for cases like this, and I can see if the engineers would be open to accepting that PR.

I did some testing and found that I could create a .coda.json file without too much trouble. Here’s what my workflow file looks like:

name: Pack Actions
on:
  push:
    branches:
      - main
jobs:
  upload-pack:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '16'
      - run: npm install
      - run: 'echo "{\"apiKey\": \"${{ secrets.CODA_API_KEY }}\"}" > .coda.json'
      - run: npx coda upload pack.ts

I hope that helps you get started!

3 Likes