Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove-disabled-packages: switch to create-pull-request action #190657

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions .github/workflows/remove-disabled-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
# Once every day at midnight UTC
- cron: "0 0 * * *"

env:
RUN_URL: ${{github.event.repository.html_url}}/actions/runs/${{github.run_id}}

concurrency:
group: remove-disabled-packages
cancel-in-progress: true
Expand Down Expand Up @@ -71,20 +74,29 @@ jobs:
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}

- name: Create pull request
id: pr-create
if: fromJson(steps.remove_disabled.outputs.packages-removed)
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
uses: Homebrew/actions/create-pull-request@master
with:
token: ${{secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN}}
base: master
head: ${{env.REMOVAL_BRANCH}}
title: Remove disabled packages
labels: CI-no-bottles
body: This pull request was created automatically by the [`remove-disabled-packages`](${{env.RUN_URL}}) workflow.

create-issue:
permissions:
issues: write # for `gh issue create`
needs: remove-disabled-packages
if: failure()
runs-on: ubuntu-latest
steps:
- name: Create issue on failure
env:
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
PR_BODY: >
This pull request was created automatically by the
[`remove-disabled-packages`](https://github.com/Homebrew/homebrew-core/blob/HEAD/.github/workflows/remove-disabled-packages.yml)
workflow.
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
gh pr create \
--base master \
--body "$PR_BODY" \
--head "$REMOVAL_BRANCH" \
--label CI-no-bottles \
--title 'Remove disabled packages' \
gh issue create \
--title 'Disabled package removal failed' \
--body "Run failed at $RUN_URL" \
--label 'bug,help wanted' \
--repo "$GITHUB_REPOSITORY"
Loading