TheCandidStartup / TheCandidStartup.github.io

The Candid Startup Blog
https://www.thecandidstartup.org
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

2024/06/24/bootstrapping-npm-provenance-github-actions #39

Open utterances-bot opened 1 week ago

utterances-bot commented 1 week ago

Bootstrapping NPM Provenance with GitHub Actions

I’m putting my money where my mouth is. NPM provenance statements are great. Everyone should publish packages with a provenance statement. Including me.

https://www.thecandidstartup.org/2024/06/24/bootstrapping-npm-provenance-github-actions.html

timwiegand commented 1 week ago

I updated the conditions in the final NPM publish workflow. The properties available on workflow_run weren't what I thought they were which I only discovered the next time I created a new version.

Top tip: If you ever need to figure out what the actual runtime context is, try throwing this step into your workflow.

    steps: 
      - name: Dump GitHub context
        env:
          GITHUB_CONTEXT: ${{ toJson(github) }}
        run: |
          echo "$GITHUB_CONTEXT"