Skip to content

Commit f8a2eb5

Browse files
committed
fix(ci): dry run mode verifies permissions
1 parent 8e6c101 commit f8a2eb5

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ jobs:
5454
name: Build with PlatformIO
5555
needs: [shellcheck, static-analysis]
5656
runs-on: ubuntu-latest
57+
permissions:
58+
contents: write
59+
issues: read
60+
pull-requests: read
61+
packages: read
5762

5863
steps:
5964
- name: Checkout code
@@ -78,23 +83,22 @@ jobs:
7883
- name: Install PlatformIO
7984
run: pip install platformio
8085

81-
- name: Install semantic-release (dry-run)
86+
- name: Install semantic-release and plugins (dry-run)
8287
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
83-
run: npm install -g semantic-release @semantic-release/commit-analyzer
88+
run: npm install -g semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github
8489

8590
- name: Compute next version and create local tag
8691
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
8792
env:
8893
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8994
run: |
90-
DRY_RUN_OUTPUT="$(semantic-release --dry-run --no-ci --plugins @semantic-release/commit-analyzer 2>&1 || true)"
95+
DRY_RUN_OUTPUT="$(semantic-release --dry-run --no-ci 2>&1 || true)"
9196
echo "$DRY_RUN_OUTPUT"
9297
9398
NEXT_VERSION="$(printf '%s\n' "$DRY_RUN_OUTPUT" | sed -nE 's/.*next release version is ([0-9]+\.[0-9]+\.[0-9]+).*/\1/p' | tail -n 1)"
9499
if [ -n "$NEXT_VERSION" ]; then
95-
TAG_NAME="v$NEXT_VERSION"
96-
git tag -f "$TAG_NAME" "$GITHUB_SHA"
97-
echo "Created local tag: $TAG_NAME"
100+
git tag -f "v$NEXT_VERSION" "$GITHUB_SHA"
101+
echo "Created local tag: v$NEXT_VERSION"
98102
git describe --tags --always --dirty=-dev --broken=-dev --abbrev=2
99103
else
100104
echo "No next release version detected, fallback to existing tags"

0 commit comments

Comments
 (0)