-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload tmp.log (will eventually exist) and only create url files if t…
…he steps succeeded
- Loading branch information
1 parent
0641b92
commit 6907d27
Showing
2 changed files
with
36 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
function usage() { | ||
printf 'USAGE: %q FILE_NAME ARTIFACT_ID OUTCOME\n' "$0" | ||
# outcome should be success, failure, cancelled, or skipped, cf https://stackoverflow.com/a/70549615/377022 | ||
exit 1 | ||
} | ||
|
||
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then | ||
usage | ||
fi | ||
|
||
filename="$1" | ||
artifact_id="$2" | ||
outcome="$3" | ||
if [ "${outcome}" == "success" ]; then | ||
printf '%s' "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/actions/artifacts/${artifact_id}/zip" | tee "${filename}.api.url" | ||
echo | ||
printf '%s' "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts/${artifact_id}" | tee "${filename}.url" | ||
echo | ||
fi |