Skip to content

Commit

Permalink
Add SHAs to outputs of action
Browse files Browse the repository at this point in the history
  • Loading branch information
fabn committed Oct 30, 2024
1 parent a6f303e commit 03a01ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ outputs:
description: Conclusion of the job, i.e pass/failure
workflow_run_id:
description: The ID of the triggered workflow run triggered by this action
full_sha:
description: The full SHA of commit that triggered the workflow
short_sha:
description: The short SHA of commit that triggered the workflow first 10 chars
runs:
using: 'docker'
image: 'Dockerfile'
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ wait_for_workflow_to_finish() {
workflow=$(api "runs/$last_workflow_id")
workflow_run_id=$(echo "${workflow}" | jq -r '.id')
echo "workflow_run_id=${workflow_run_id}" >> $GITHUB_OUTPUT
head_sha=$(echo "${workflow}" | jq -r '.head_sha')
echo "full_sha=${full_sha}" >> $GITHUB_OUTPUT
echo "short_sha=${full_sha:0:10}" >> $GITHUB_OUTPUT

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

0 comments on commit 03a01ea

Please sign in to comment.