-
-
Notifications
You must be signed in to change notification settings - Fork 8
88 lines (78 loc) · 2.48 KB
/
auto-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
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: 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