-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (67 loc) · 2.62 KB
/
fetch.yaml
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
name: Fetch references
on:
schedule:
# At 7:00 EST (12:00 UTC) on every day-of-week from Monday through Friday. https://crontab.guru/#0_12_*_*_1-5
- cron: "0 12 * * 1-5"
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
fetch-references:
runs-on: ubuntu-latest
if: github.repository == 'bufbuild/modules'
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
with:
app_id: 295926
private_key: ${{ secrets.TOKEN_EXCHANGE_GH_APP_PRIVATE_KEY }}
permissions: >-
{"contents": "write", "pull_requests": "write", "members": "read"}
- name: Checkout repository code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
check-latest: true
cache: true
- name: Install buf cli
run: |
go install github.com/bufbuild/buf/cmd/buf@latest
- name: Fetch references
run: |
bash ./scripts/fetch.sh
env:
BUF_USER: ${{ secrets.BUF_USER }}
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create PR
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c
with:
add-paths: ./modules/sync/**
commit-message: "Detected new managed modules references"
# This branch is ignored for the 'buf-ci.yaml' action. Keep this branch name synced there.
branch: fetch-modules
delete-branch: true
title: "Found new managed modules references"
body: |
New managed modules references found. Please review.
- [ ] `envoyproxy/envoy` has updates, I have checked https://github.com/bufbuild/modules/issues/591
- [ ] `googlecloudplatform/bq-schema-api` has updates, I have checked https://github.com/bufbuild/modules/issues/592
team-reviewers: bufbuild/bsr-team
token: ${{ steps.generate_token.outputs.token }}
- uses: dblock/create-a-github-issue@c5e54b8762a0c4c2cd9330750e30b81bcc369c38
if: failure()
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_SERVER_URL: ${ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
with:
filename: .github/automatic-workflow-issue-template.md
update_existing: true
search_existing: open