Skip to content

Commit 50e824a

Browse files
committed
.github/workflows/01-make-dist.yml: there is no env.GITHUB_HEAD_REF [#1400]
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 11b1153 commit 50e824a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/01-make-dist.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ jobs:
3737
- name: Checkout repository
3838
uses: actions/checkout@v3
3939

40+
# https://github.com/marketplace/actions/substitute-string
41+
- uses: bluwy/substitute-string-action@v3
42+
id: subst-github-ref-name
43+
with:
44+
_input-text: "${{ github.ref_name }}"
45+
" ": _
46+
"/": _
47+
4048
# Using hints from https://askubuntu.com/questions/272248/processing-triggers-for-man-db
4149
# and our own docs/config-prereqs.txt
4250
# NOTE: Currently installing the MAX prerequisite footprint,
@@ -168,7 +176,7 @@ jobs:
168176
# We may want another script block (after this cleanup of obsolete data)
169177
# to iterate clearing the way build by build until there's X MB available
170178
# (at least 12MB as of Nov 2025).
171-
- if: env.GITHUB_REF_TYPE != 'tag' && env.GITHUB_HEAD_REF != 'master'
179+
- if: env.GITHUB_REF_TYPE != 'tag' && steps.subst-github-ref.outputs.result != 'master'
172180
name: Delete Old Artifacts for this feature branch/PR
173181
uses: actions/github-script@v6
174182
id: artifact
@@ -180,7 +188,7 @@ jobs:
180188
})
181189
182190
res.data.artifacts
183-
.filter(({ name }) => name === 'tarballs-${{ env.GITHUB_HEAD_REF }}')
191+
.filter(({ name }) => name === 'tarballs-${{ steps.subst-github-ref.outputs.result }}')
184192
.forEach(({ id }) => {
185193
github.rest.actions.deleteArtifact({
186194
owner: context.repo.owner,
@@ -192,7 +200,7 @@ jobs:
192200
- name: Upload tarball and its checksum artifacts
193201
uses: actions/upload-artifact@v4
194202
with:
195-
name: tarballs-${{ env.GITHUB_HEAD_REF }}
203+
name: tarballs-${{ steps.subst-github-ref.outputs.result }}
196204
path: |
197205
nut-*.tar*
198206
compression-level: 0

0 commit comments

Comments
 (0)