Skip to content

Remove disabled formulae #375

Remove disabled formulae

Remove disabled formulae #375

name: Remove disabled formulae
on:
push:
paths:
- .github/workflows/remove-disabled-formulae.yml
schedule:
# Once every day at midnight UTC
- cron: "0 0 * * *"
concurrency:
group: remove-disabled-formulae
cancel-in-progress: true
permissions:
contents: read
jobs:
remove-disabled-formulae:
if: github.repository_owner == 'Homebrew'
runs-on: ubuntu-latest
container:
image: ghcr.io/homebrew/ubuntu22.04:master
env:
REMOVAL_BRANCH: remove-disabled-formulae
permissions:
contents: write # for Homebrew/actions/git-try-push
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
core: true
cask: false
test-bot: false
- name: Configure Git user
id: git-user-config
uses: Homebrew/actions/git-user-config@master
with:
username: BrewTestBot
- name: Set up commit signing
uses: Homebrew/actions/setup-commit-signing@master
with:
signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }}
- name: Checkout removal branch
run: git checkout -b "$REMOVAL_BRANCH" origin/master
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
- name: Remove disabled formulae
id: remove_disabled
uses: Homebrew/actions/remove-disabled-formulae@master
env:
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
HOMEBREW_EVAL_ALL: 1
- name: Push commits
if: fromJson(steps.remove_disabled.outputs.formulae-removed)
uses: Homebrew/actions/git-try-push@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
branch: ${{ env.REMOVAL_BRANCH }}
env:
GIT_COMMITTER_NAME: ${{ steps.git-user-config.outputs.name }}
GIT_COMMITTER_EMAIL: ${{ steps.git-user-config.outputs.email }}
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
- name: Create pull request
id: pr-create
if: fromJson(steps.remove_disabled.outputs.formulae-removed)
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
env:
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
PR_BODY: >
This pull request was created automatically by the
[`remove-disabled-formulae`](https://github.com/Homebrew/homebrew-core/blob/HEAD/.github/workflows/remove-disabled-formulae.yml)
workflow.
run: |
gh pr create \
--base master \
--body "$PR_BODY" \
--head "$REMOVAL_BRANCH" \
--label CI-no-bottles \
--title 'Remove disabled formulae'