Skip to content

Fetch references

Fetch references #851

Workflow file for this run

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: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
with:
app-id: 295926
private-key: ${{ secrets.TOKEN_EXCHANGE_GH_APP_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
permission-members: read
- name: Checkout repository code
uses: actions/checkout@v5
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: 1.24.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_TOKEN: ${{ secrets.BUF_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create PR
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
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.
team-reviewers: bufbuild/core-team
token: ${{ steps.generate_token.outputs.token }}
- name: Generate Github Token
id: generate_issues_token
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
if: ${{ failure() }}
with:
app-id: ${{ secrets.BUFBUILD_ISSUE_CREATOR_APP_ID }}
private-key: ${{ secrets.BUFBUILD_ISSUE_CREATOR_APP_KEY }}
permission-issues: write
- uses: dblock/create-a-github-issue@c5e54b8762a0c4c2cd9330750e30b81bcc369c38
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ steps.generate_issues_token.outputs.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