Skip to content

Commit

Permalink
ci: add notice on repo mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Oct 29, 2024
1 parent a6d2c1a commit 59f81b0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/npm-publish-from-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Notice
if: github.event.inputs.repo != github.repository
run: node -e "const fs = require('fs'); fs.writeFileSync('./README.md', process.env.NOTICE + fs.readFileSync('./README.md'))"
env:
NOTICE: "> ⚠<fe0f> **This snapshot was built from the external source** \n> repo: ${{ github.event.inputs.repo }} \n> commit: ${{ github.event.inputs.commit }}\n"

- run: |
node -e "const fs = require('fs'); fs.writeFileSync('./README.md', process.env.NOTICE + fs.readFileSync('./README.md'))"
npm version $(node --eval="process.stdout.write(require('./package.json').version)")-pr.${{ github.run_id }} --no-git-tag-version
npm publish --provenance --access=public --no-git-tag-version --tag pr
env:
NOTICE: "> ⚠<fe0f> **This snapshot was built from the external source** \n> repo: ${{ github.event.inputs.repo }} \n> commit: ${{ github.event.inputs.commit }}\n"

0 comments on commit 59f81b0

Please sign in to comment.