Skip to content

Commit

Permalink
Merge pull request #346 from oasisprotocol/lw/harden-gh-actions
Browse files Browse the repository at this point in the history
workflow: Harden GitHub workflow against injection
  • Loading branch information
lukaw3d authored Aug 14, 2024
2 parents 865b6ec + 57eb02b commit 1f7939f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ jobs:
run: pnpm build
- name: Extract package from tag
id: extract-tag
env:
# There's no support for escaping this for use in a shell command.
# GitHub's recommendation is to pass it through the environment.
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
REF_NAME: ${{ github.ref_name }}
run: |
echo "NPM_PACKAGE=$(echo ${{ github.ref_name }} | grep -oE '(clients/js|contracts|integrations/(hardhat|wagmi-v2|viem-v2))')" >> $GITHUB_OUTPUT
echo "NPM_PACKAGE=$(echo $REF_NAME | grep -oE '(clients/js|contracts|integrations/(hardhat|wagmi-v2|viem-v2))')" >> $GITHUB_OUTPUT
- name: Publish ${{ github.ref_name }} to NPM
uses: JS-DevTools/npm-publish@v3
with:
Expand Down

0 comments on commit 1f7939f

Please sign in to comment.