Skip to content

Commit 073cbaf

Browse files
committed
try to fix the ref handling
1 parent 9478ff5 commit 073cbaf

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/release.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
name: Update changelog
4949
runs-on: ubuntu-latest
5050
outputs:
51-
changelog_commitish: ${{ steps.get_sha.outputs.commit_sha || steps.commit.outputs.commit_long_sha || github.sha }}
51+
changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }}
5252

5353
steps:
5454
- name: Checkout repository
@@ -91,7 +91,6 @@ jobs:
9191
9292
- name: Get commit SHA
9393
id: get_sha
94-
if: steps.commit.outputs.commit_long_sha != ''
9594
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
9695

9796
create_github_release:
@@ -101,9 +100,17 @@ jobs:
101100
env:
102101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103102
steps:
103+
- name: Validate commit SHA
104+
run: |
105+
COMMIT_SHA="${{ needs.update_changelog.changelog_commitish }}"
106+
if [ -z "$COMMIT_SHA" ]; then
107+
echo "ERROR: changelog_commitish is empty!"
108+
exit 1
109+
fi
110+
echo "Using commit SHA: $COMMIT_SHA"
104111
- uses: actions/checkout@v4
105112
with:
106-
ref: ${{ needs.update_changelog.changelog_commitish }}
113+
ref: ${{ needs.update_changelog.changelog_commitish || github.sha }}
107114
- name: Log current commit SHA
108115
run: |
109116
CURRENT_SHA=$(git rev-parse HEAD)

0 commit comments

Comments
 (0)