Skip to content

Commit 3ee56df

Browse files
alixinnerenovate[bot]
authored andcommitted
ci: handle PRs which don't trigger a release
1 parent ef0168c commit 3ee56df

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/build.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ jobs:
2929
with:
3030
fetch-depth: 0
3131

32+
- name: Store repository head
33+
id: head_before_release
34+
shell: bash
35+
run: echo head=$(git rev-parse HEAD) >> $GITHUB_OUTPUT
36+
3237
- name: Check conventional commits
3338
uses: cocogitto/[email protected]
3439
# We handle the failure explicitely so this doesn't block the build
@@ -55,7 +60,7 @@ jobs:
5560
- name: Compute workflow outputs
5661
id: outputs
5762
run: |
58-
if [[ "${{ steps.check.outcome }}" == "success" && "${{ steps.release.outcome }}" == "success" ]]; then
63+
if [[ "${{ steps.check.outcome }}" == "success" && "${{ steps.release.outcome }}" == "success" && "$(git rev-parse HEAD)" != "${{ steps.head_before_release.outputs.head }}" ]]; then
5964
echo "A new release will be created: ${{ steps.release.outputs.version }}"
6065
6166
# Generate changelog
@@ -261,14 +266,14 @@ jobs:
261266

262267
- name: Prepare release
263268
run: |
264-
RELEASE_NAME=$(git describe --tags --abbrev=0)
269+
RELEASE_NAME=$(git describe --tags --abbrev=0 --always)
265270
(cd target/${{ matrix.target }}/release && tar czf ${{ github.workspace }}/target/glslt-$RELEASE_NAME-${{ matrix.target }}.tar.gz glsltc)
266271
if: matrix.os == 'ubuntu-latest'
267272

268273
- name: Prepare release
269274
run: |
270275
del target\glslt*.tar.gz
271-
$ReleaseName = & git describe --tags --abbrev=0
276+
$ReleaseName = & git describe --tags --abbrev=0 --always
272277
cd target/${{ matrix.target }}/release
273278
7z a ${{ github.workspace }}/target/glslt-$ReleaseName-${{ matrix.target }}.7z glsltc.exe
274279
if: matrix.os == 'windows-latest'

0 commit comments

Comments
 (0)