Skip to content

Commit

Permalink
Merge pull request #205 from chenrui333/autobump
Browse files Browse the repository at this point in the history
feat: add autobump flow
  • Loading branch information
MikeMcQuaid authored May 29, 2024
2 parents aba20d1 + 34a9aa8 commit 8e318aa
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/autobump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Bump formulae on schedule or request

on:
push:
branches:
- master
paths:
- .github/workflows/autobump.yml
workflow_dispatch:
inputs:
formulae:
description: Custom list of portable-ruby formulae to livecheck and bump if outdated
required: false
schedule:
# Daily at midnight
- cron: "0 0 * * *"

permissions:
contents: read

jobs:
autobump:
if: github.repository_owner == 'Homebrew'
runs-on: ubuntu-22.04
container:
image: ghcr.io/homebrew/ubuntu22.04:master
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
core: false
cask: false
test-bot: false

- name: Configure Git user
uses: Homebrew/actions/git-user-config@master
with:
username: ${{ (github.event_name == 'workflow_dispatch' && github.actor) || 'BrewTestBot' }}

- name: Get list of autobump portable-ruby formulae
id: autobump
run: echo "autobump_list=$(brew tap-info --json "${GITHUB_REPOSITORY}" | jq -r '.[].formula_names[]')" >> "$GITHUB_OUTPUT"

- name: Bump portable-ruby formulae
uses: Homebrew/actions/bump-packages@master
continue-on-error: true
with:
token: ${{ secrets.HOMEBREW_PORTABLE_RUBY_REPO_WORKFLOW_TOKEN }}
formulae: ${{ github.event.inputs.formulae || steps.autobump.outputs.autobump_list }}
env:
HOMEBREW_TEST_BOT_AUTOBUMP: 1

0 comments on commit 8e318aa

Please sign in to comment.