-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.5 KB
/
autobump.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
name: Autobump
on:
push:
# Run every day at 8:00 AM
schedule:
- cron: '0 8 * * *'
workflow_dispatch:
env:
HOMEBREW_FORCE_HOMEBREW_ON_LINUX: 1
jobs:
autobump:
if: github.repository == 'fwcd/homebrew-fwcd'
runs-on: macos-latest
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install dependencies
run: brew install jq
- name: Set up Git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump casks
run: |
set -e
cd "$(brew --repo fwcd/fwcd)"
for cask_path in Casks/*; do
cask_file="${cask_path##*/}"
cask="${cask_file%.*}"
echo "==> Checking $cask..."
status_json=`brew livecheck --json $cask`
echo "Status: $status_json"
if jq -e '.[0].version.outdated' <<< "$status_json" >/dev/null; then
latest_version=`jq -r '.[0].version.latest' <<< "$status_json"`
echo "==> Bumping outdated $cask to $latest_version..."
brew bump-cask-pr --write-only --commit --version "$latest_version" $cask
fi
done
shell: bash
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
- name: Push changes
run: |
set -e
cd "$(brew --repo fwcd/fwcd)"
git push "https://${{ github.actor }}:${{ github.token }}@github.com/fwcd/homebrew-fwcd.git"