Skip to content

Commit 4a4b784

Browse files
authored
[skip changelog] Restore globbing of nightly build artifact filename (#1781)
During a refactoring of the "Publish Nightly Build" workflow, globbing of the macOS build artifact filename in the repackaging step was accidentally lost, causing the glob pattern to be treated instead as a string and the updated package saved to a file named by that string instead of to the original filename. This resulted in the workflow failing with errors like: Artifact path is not valid: /arduino-cli_nightly-*macOS_64bit.tar.gz. Contains the following character: Asterisk * The previous `basename` command was providing the globbing. After the refactoring, `basename` is no longer needed, so an alternative way to achieve globbing is needed. It seems the preferred approach is use of an array. Since the globbing will only expand to a single filename, the array can be referenced as before by the rest of the step, since it will resolve to the first element in the array (equivalent to `$PACKAGE_FILENAME[0]`).
1 parent 0de6c37 commit 4a4b784

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: .github/workflows/publish-go-nightly-task.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ jobs:
139139
# GitHub's upload/download-artifact@v2 actions don't preserve file permissions,
140140
# so we need to add execution permission back until the action is made to do this.
141141
chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
142-
PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_nightly-*${{ matrix.artifact.path }}"
142+
# Use of an array here is required for globbing
143+
PACKAGE_FILENAME=(${{ env.PROJECT_NAME }}_nightly-*${{ matrix.artifact.path }})
143144
tar -czvf "$PACKAGE_FILENAME" \
144145
-C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
145146
-C ../../ LICENSE.txt

0 commit comments

Comments
 (0)