diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cc332e9..9dde586 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -51,3 +51,4 @@ jobs: trigger_workflow: true wait_workflow: true propagate_failure: true + summarize: true diff --git a/README.md b/README.md index 1c389b1..0f2d3a3 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ When deploying an app you may need to deploy additional services, this Github Ac | `wait_workflow` | False | `true` | Wait for workflow to finish. | | `comment_downstream_url` | False | `` | A comments API URL to comment the current downstream job URL to. Default: no comment | | `comment_github_token` | False | `${{github.token}}` | token used for pull_request comments | +| `summarize` | False | `false` | Print downstream job URL and ID to workflow job summary | ## Example diff --git a/action.yml b/action.yml index f6df592..18bbc1c 100644 --- a/action.yml +++ b/action.yml @@ -46,6 +46,9 @@ inputs: description: "The Github access token with access to the repository for comment URL. It is recommended you put this token under secrets." required: false default: ${{ github.token }} + summarize: + description: "Print downstream job URL and ID to workflow job summary. default: false" + required: false outputs: workflow_id: description: The ID of the workflow that was triggered by this action diff --git a/entrypoint.sh b/entrypoint.sh index e8c3826..225eb7f 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -39,6 +39,12 @@ validate_args() { wait_workflow=${INPUT_WAIT_WORKFLOW} fi + summarize=false + if [ -n "${INPUT_SUMMARIZE}" ] + then + summarize=${INPUT_SUMMARIZE} + fi + if [ -z "${INPUT_OWNER}" ] then echo "Error: Owner is a required argument." @@ -181,6 +187,15 @@ wait_for_workflow_to_finish() { comment_downstream_link ${last_workflow_url} fi + if [ "${summarize}" = true ] + then + echo "| | |" >> $GITHUB_STEP_SUMMARY + echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY + echo "| Workflow URL | <${last_workflow_url}> |" >> $GITHUB_STEP_SUMMARY + echo "| Workflow ID | ${last_workflow_id} |" >> $GITHUB_STEP_SUMMARY + echo "| | |" >> $GITHUB_STEP_SUMMARY + fi + conclusion=null status= @@ -194,6 +209,7 @@ wait_for_workflow_to_finish() { echo "Checking conclusion [${conclusion}]" echo "Checking status [${status}]" + echo "Workflow logs: ${last_workflow_url}" echo "conclusion=${conclusion}" >> $GITHUB_OUTPUT done