Skip to content

Commit

Permalink
Merge pull request #938 from ersilia-os/workflow-fixes
Browse files Browse the repository at this point in the history
add a comment for the user on failure
  • Loading branch information
miquelduranfrigola authored Jan 2, 2024
2 parents 74dba7f + a783667 commit 4b8074e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/templates/approve-workflow-failed.md
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 }})
18 changes: 18 additions & 0 deletions .github/workflows/approve-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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 }}

0 comments on commit 4b8074e

Please sign in to comment.