Skip to content

Commit 6b79078

Browse files
Add workflow_id and workflow_url as action outputs (#14)
1 parent 5dfe28a commit 6b79078

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ inputs:
3535
wait_workflow:
3636
description: 'Wait for workflow to finish. default: true'
3737
required: false
38+
outputs:
39+
workflow_id:
40+
description: The ID of the workflow that was triggered by this action
41+
workflow_url:
42+
description: The URL of the workflow that was triggered by this action
3843
runs:
3944
using: 'docker'
4045
image: 'Dockerfile'

entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ wait_for_workflow_to_finish() {
9595
-H 'Accept: application/vnd.github.antiope-preview+json' \
9696
-H "Authorization: Bearer ${INPUT_GITHUB_TOKEN}" | jq '[.workflow_runs[]] | first')
9797
last_workflow_id=$(echo "${last_workflow}" | jq '.id')
98+
last_workflow_url="https://github.com/${INPUT_OWNER}/${INPUT_REPO}/actions/runs/${last_workflow_id}"
9899
echo "The workflow id is [${last_workflow_id}]."
100+
echo "The workflow logs can be found at ${last_workflow_url}"
101+
echo "::set-output name=workflow_id::${last_workflow_id}"
102+
echo "::set-output name=workflow_url::${last_workflow_url}"
99103
echo ""
100104
conclusion=$(echo "${last_workflow}" | jq '.conclusion')
101105
status=$(echo "${last_workflow}" | jq '.status')

0 commit comments

Comments
 (0)