Skip to content

Commit

Permalink
Add last run id to the outputs of the action
Browse files Browse the repository at this point in the history
  • Loading branch information
fabn committed Oct 30, 2024
1 parent f69fa9e commit a6f303e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ outputs:
description: The URL of the workflow that was triggered by this action
conclusion:
description: Conclusion of the job, i.e pass/failure
workflow_run_id:
description: The ID of the triggered workflow run triggered by this action
runs:
using: 'docker'
image: 'Dockerfile'
7 changes: 6 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ api() {
echo >&2 "api failed:"
echo >&2 "path: $path"
echo >&2 "response: $response"
if [[ "$response" == *'"Server Error"'* ]]; then
if [[ "$response" == *'"Server Error"'* ]]; then
echo "Server error - trying again"
else
exit 1
Expand Down Expand Up @@ -196,6 +196,11 @@ wait_for_workflow_to_finish() {
echo "conclusion=${conclusion}" >> $GITHUB_OUTPUT
done

# Add the run ID to the outputs of the action
workflow=$(api "runs/$last_workflow_id")
workflow_run_id=$(echo "${workflow}" | jq -r '.id')
echo "workflow_run_id=${workflow_run_id}" >> $GITHUB_OUTPUT

if [[ "${conclusion}" == "success" && "${status}" == "completed" ]]
then
echo "Yes, success"
Expand Down

0 comments on commit a6f303e

Please sign in to comment.