Submit PRs for audit results #756
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Submit PRs for audit results | |
on: | |
workflow_dispatch: | |
inputs: | |
pr-limit: | |
required: true | |
default: 5 | |
type: number | |
dry-run: | |
required: true | |
default: true | |
type: boolean | |
ref: | |
required: false | |
default: '' | |
type: string | |
workflow_call: | |
inputs: | |
pr-limit: | |
default: 25 | |
type: number | |
dry-run: | |
default: false # don't dry-run by default when called from another workflow | |
type: boolean | |
ref: | |
default: ${{ github.ref }} | |
type: string | |
jobs: | |
auto-pr: | |
runs-on: macos-latest | |
timeout-minutes: 120 | |
steps: | |
- name: Display inputs | |
run: | | |
echo "AUTO_PR_DRY_RUN: ${AUTO_PR_DRY_RUN}" | |
echo "AUTO_PR_LIMIT: ${AUTO_PR_LIMIT}" | |
env: | |
AUTO_PR_DRY_RUN: ${{ inputs.dry-run }} | |
AUTO_PR_LIMIT: ${{ inputs.pr-limit }} | |
- name: Check out this repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
# will expand to '' when unset in workflow_dispatch, i.e. default branch | |
ref: ${{ inputs.ref }} | |
- name: Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
with: | |
core: true | |
cask: false | |
test-bot: false | |
- name: Cache Homebrew Bundler RubyGems | |
id: cache | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
with: | |
path: ${{ steps.set-up-homebrew.outputs.gems-path }} | |
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} | |
restore-keys: ${{ runner.os }}-rubygems- | |
- name: Install Homebrew Bundler RubyGems | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: brew install-bundler-gems --groups=all | |
- name: Configure git | |
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_SSH_SIGNING_KEY }} | |
- name: Install dependencies | |
run: brew install augeas autoconf | |
- name: Generate Pull Requests | |
run: brew ruby generate-prs.rb | |
env: | |
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.BREW_PIP_AUDIT_GH_TOKEN }} | |
HOMEBREW_AUTO_PR_DRY_RUN: ${{ inputs.dry-run }} | |
HOMEBREW_AUTO_PR_NO_FORK: true | |
HOMEBREW_AUTO_PR_LIMIT: ${{ inputs.pr-limit }} | |
HOMEBREW_NO_INSTALL_FROM_API: 1 | |
HOMEBREW_EVAL_ALL: 1 |