Skip to content

Commit cd7a4fc

Browse files
author
rahul-infra
committed
updated workflow.
1 parent 4777601 commit cd7a4fc

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

.github/workflows/release-preview.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
name: Preview Release
99
runs-on: ubuntu-latest
1010
permissions:
11-
contents: read
11+
contents: write # Required for semantic-release to verify git push (even in dry-run mode)
1212
pull-requests: write
1313

1414
steps:
@@ -66,7 +66,6 @@ jobs:
6666
id: semantic
6767
env:
6868
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
# Skip git verification to avoid needing write permissions
7069
GIT_COMMITTER_NAME: "github-actions[bot]"
7170
GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
7271
GIT_AUTHOR_NAME: "github-actions[bot]"
@@ -82,16 +81,6 @@ jobs:
8281
export GITHUB_REF="refs/heads/${{ github.event.pull_request.head.ref }}"
8382
export GITHUB_REF_NAME="${{ github.event.pull_request.head.ref }}"
8483
85-
# Mock git push to avoid permission errors (semantic-release will skip actual push in dry-run)
86-
git() {
87-
if [[ "$1" == "push" ]]; then
88-
echo "[DRY-RUN] Skipping git push verification"
89-
return 0
90-
fi
91-
command git "$@"
92-
}
93-
export -f git
94-
9584
echo "=== Debug Info ==="
9685
echo "Expected branch: ${{ github.event.pull_request.head.ref }}"
9786
echo "Current git branch: $(git branch --show-current)"

0 commit comments

Comments
 (0)