-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
57 lines (51 loc) 路 1.69 KB
/
tapioca-update.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
name: Tapioca Update
on:
push:
paths:
- .github/workflows/tapioca-update.yml
schedule:
- cron: '0 0 */3 * *' # every three days
env:
HOMEBREW_SORBET: 1
jobs:
update-tapioca:
if: github.repository == 'Homebrew/brew'
runs-on: ubuntu-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 Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.3
- name: Update Tapioca Definitions
run: |
cd "$GITHUB_WORKSPACE/Library/Homebrew"
bundle install
bundle exec tapioca sync --exclude json
bundle exec srb rbi hidden-definitions
if ! git diff --exit-code -- sorbet; then
BRANCH="tapioca-update"
if ! git ls-remote --exit-code --heads origin "$BRANCH"; then
git checkout -b "$BRANCH"
git commit -am "sorbet: Update gem RBI files using Tapioca
Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/actions?query=workflow%3A%22Tapioca+Update%22)."
fi
fi
- name: Push commits
uses: Homebrew/actions/git-try-push@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: tapioca-update
directory: Library/Homebrew/
- name: Open a PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd "$GITHUB_WORKSPACE/Library/Homebrew"
hub pull-request -m "$(git log -1 --format='%s')"