-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 2.03 KB
/
test.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
name: Test Formulae Update
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: write
pull-requests: write
jobs:
test-formulae:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
- name: Install dependencies
run: |
gem install nokogiri
gem install rubocop
gem install bundler-audit
bundle install
- name: Configure Git
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git config --global user.name 'yakdriverbot'
git config --global user.email 'f1formula.juan@gmail.com'
git config --global pull.rebase true
git remote set-url origin https://$GH_PAT@github.com/YakDriver/homebrew-tap.git
git pull origin ${{ github.head_ref }}
- name: RuboCop Auto-correct
run: |
rubocop --autocorrect
- name: Commit RuboCop fixes
run: |
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Apply RuboCop auto-correct fixes"
echo "Pushing changes to ${{ github.head_ref }}"
git push origin HEAD:${{ github.head_ref }}
else
echo "No changes to commit"
fi
- name: RuboCop check
run: |
rubocop
- name: Run Bundler Audit
run: |
bundle exec bundler-audit check --update
- name: Run update script
run: |
ruby update.rb
- name: Read update summary
id: read_summary
run: |
echo "UPDATE_SUMMARY<<EOF" >> $GITHUB_ENV
cat update_summary.txt >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Verify update summary
run: |
if [ ! -s update_summary.txt ]; then
echo "Update summary is empty"
exit 1
fi
echo "Update summary is set"