-
-
Notifications
You must be signed in to change notification settings - Fork 48
62 lines (55 loc) · 1.79 KB
/
update-database.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
name: Scheduled database updates
on:
push:
branches:
- master
paths:
- .github/workflows/update-database.yml
schedule:
# Once every day at midnight UTC
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
max-downloads:
description: Maximum number of formulae to download when updating
required: false
jobs:
update-database:
if: startsWith( github.repository, 'Homebrew/' )
runs-on: macos-latest
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Configure Git user
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: Check out repository
uses: actions/checkout@main
with:
fetch-depth: 0
ref: master
path: repo
- name: Update database
working-directory: repo
env:
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
run: |
if [[ -n "${{ github.event.inputs.max-downloads }}" ]]
then
MAX_DOWNLOADS_ARGS="--max-downloads ${{ github.event.inputs.max-downloads }}"
fi
brew which-update --commit --update-existing --install-missing $MAX_DOWNLOADS_ARGS executables.txt
- name: Output database stats
working-directory: repo
run: brew which-update --stats executables.txt
- name: Push commits
uses: Homebrew/actions/git-try-push@master
with:
token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
directory: repo