Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:

permissions:
id-token: write
Comment on lines 7 to 8

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore contents permission for checkout

The workflow now grants only id-token: write, which removes the default contents: read when a permissions block is present. actions/checkout@v4 requires contents access, so the publish job will fail immediately with “Resource not accessible by integration” and never reach the build/publish steps.

Useful? React with 👍 / 👎.

contents: write

jobs:
publish:
Expand All @@ -30,22 +29,12 @@ jobs:
PUBLISHED=$(npm view pr-visual version 2>/dev/null || echo "0.0.0")
if [ "$CURRENT" != "$PUBLISHED" ]; then
echo "publish=true" >> $GITHUB_OUTPUT
echo "bump=false" >> $GITHUB_OUTPUT
echo "Version $CURRENT not published yet"
echo "Version $CURRENT is new, will publish"
else
echo "publish=true" >> $GITHUB_OUTPUT
echo "bump=true" >> $GITHUB_OUTPUT
echo "Version $CURRENT already published, will bump"
echo "publish=false" >> $GITHUB_OUTPUT
echo "Version $CURRENT already published, skipping"
fi

- name: Bump version
if: steps.check.outputs.bump == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
npm version patch -m "Bump version to %s [skip ci]"
git push

- name: Publish to npm
if: steps.check.outputs.publish == 'true'
run: npm publish --access public