|
18 | 18 | fetch-depth: 0 |
19 | 19 | ref: ${{ github.event.pull_request.head.ref }} |
20 | 20 |
|
| 21 | + - name: Setup branch for semantic-release |
| 22 | + run: | |
| 23 | + # Explicitly checkout to the PR branch by name |
| 24 | + git checkout -B ${{ github.event.pull_request.head.ref }} |
| 25 | + echo "Current branch: $(git branch --show-current)" |
| 26 | + echo "Git status:" |
| 27 | + git status |
| 28 | +
|
21 | 29 | - name: Setup Node.js |
22 | 30 | uses: actions/setup-node@v4 |
23 | 31 | with: |
|
28 | 36 | # Backup original config |
29 | 37 | cp .releaserc.json .releaserc.json.bak |
30 | 38 |
|
| 39 | + echo "=== Original .releaserc.json ===" |
| 40 | + cat .releaserc.json.bak |
| 41 | + echo "================================" |
| 42 | + echo "" |
| 43 | +
|
31 | 44 | # Update config for preview mode using the PR branch name |
32 | 45 | cat > .releaserc.json << EOF |
33 | 46 | { |
|
43 | 56 | } |
44 | 57 | EOF |
45 | 58 |
|
46 | | - echo "Updated .releaserc.json for branch: ${{ github.event.pull_request.head.ref }}" |
| 59 | + echo "=== Updated .releaserc.json ===" |
| 60 | + cat .releaserc.json |
| 61 | + echo "===============================" |
| 62 | + echo "" |
| 63 | + echo "Config updated for branch: ${{ github.event.pull_request.head.ref }}" |
47 | 64 |
|
48 | 65 | - name: Run semantic-release (dry-run) |
49 | 66 | id: semantic |
|
54 | 71 | GITHUB_REF_NAME: ${{ github.event.pull_request.head.ref }} |
55 | 72 | GITHUB_HEAD_REF: "" |
56 | 73 | run: | |
57 | | - echo "Running semantic-release on branch: ${{ github.event.pull_request.head.ref }}" |
| 74 | + echo "=== Debug Info ===" |
| 75 | + echo "Expected branch: ${{ github.event.pull_request.head.ref }}" |
| 76 | + echo "Current git branch: $(git branch --show-current)" |
| 77 | + echo "GITHUB_REF: $GITHUB_REF" |
| 78 | + echo "GITHUB_REF_NAME: $GITHUB_REF_NAME" |
| 79 | + echo "GITHUB_HEAD_REF: $GITHUB_HEAD_REF" |
| 80 | + echo "==================" |
| 81 | + echo "" |
58 | 82 |
|
59 | 83 | # Run semantic-release with inline package installation (same as your local command) |
60 | 84 | OUTPUT=$(npx --package semantic-release --package @semantic-release/exec --package conventional-changelog-conventionalcommits semantic-release 2>&1 || true) |
|
0 commit comments