-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #938 from ersilia-os/workflow-fixes
add a comment for the user on failure
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### Workflow Failure ❌ | ||
|
||
@{{ issue_creator }} (or other maintainers) the `/approve` workflow has failed. View the logs here for more information: | ||
|
||
🔗 [Workflow logs]({{ workflow_url }}) | ||
|
||
You may need to delete the following repo that was created via this workflow run since the run was not fully successful: [ersilia-os/{{ repo_name }}](https://github.com/ersilia-os/{{ repo_name }}) |
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 |
---|---|---|
|
@@ -15,6 +15,12 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # [email protected] | ||
|
||
# construct the url to this workflow run | ||
- name: workflow url | ||
id: workflow-url | ||
run: | | ||
echo "workflow_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT | ||
# parse the issue body from free form text to a structured JSON object | ||
- name: parse issue | ||
uses: GrantBirki/[email protected] | ||
|
@@ -161,3 +167,15 @@ jobs: | |
vars: | | ||
repo_name: ${{ steps.create-model-repo.outputs.repo_name }} | ||
issue_creator: ${{ steps.issue-creator.outputs.issue_creator }} | ||
# steps to run if the workflow fails for any reason | ||
- name: comment on failure | ||
if: failure() | ||
uses: GrantBirki/comment@7016e89e8f225b0f18f1fbb7fd10263df2772a05 # [email protected] | ||
with: | ||
issue-number: ${{ github.event.client_payload.github.payload.issue.number }} | ||
file: .github/templates/approve-workflow-failed.md | ||
vars: | | ||
repo_name: ${{ steps.create-model-repo.outputs.repo_name }} | ||
issue_creator: ${{ steps.issue-creator.outputs.issue_creator }} | ||
workflow_url: ${{ steps.workflow-url.outputs.workflow_url }} |