Skip to content

Commit

Permalink
workflows/remove-disabled-packages: use create-or-update-issue action
Browse files Browse the repository at this point in the history
This was added in Homebrew/actions#588. It can also automatically update
an existing issue on repeated failures, or close the issue when the
latest workflow run is successful.
  • Loading branch information
ZhongRuoyu committed Sep 24, 2024
1 parent d4d6cd0 commit fc4a8ca
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/remove-disabled-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,18 @@ jobs:

create-issue:
permissions:
issues: write # for `gh issue create`
issues: write # for Homebrew/actions/create-or-update-issue
needs: remove-disabled-packages
if: failure()
if: always() && github.repository_owner == 'Homebrew'
runs-on: ubuntu-latest
steps:
- name: Create issue on failure
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
gh issue create \
--title 'Disabled package removal failed' \
--body "Run failed at $RUN_URL" \
--label 'bug,help wanted' \
--repo "$GITHUB_REPOSITORY"
uses: Homebrew/actions/create-or-update-issue@master
with:
title: Disabled package removal failed
body: Run failed at ${{ env.RUN_URL }}
labels: bug,help wanted
update-existing: ${{ needs.remove-disabled-packages.result == 'failure' }}
close-existing: ${{ needs.remove-disabled-packages.result == 'success' }}
close-from-author: github-actions[bot]
close-comment: Run succeeded at ${{ env.RUN_URL }}, closing issue.

0 comments on commit fc4a8ca

Please sign in to comment.