Skip to content

Commit 551404c

Browse files
authored
Use github app to create issues (#1722)
To prevent getting caught in rate limits.
1 parent 07557d4 commit 551404c

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

.github/workflows/fetch_versions.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,19 @@ jobs:
7171
body: "New plugin versions found. Please review."
7272
assignees: mfridman, pkwarren, stefanvanburen
7373
token: ${{ steps.generate_token.outputs.token }}
74+
- name: Generate Github Token
75+
id: generate_issues_token
76+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
77+
if: ${{ failure() }}
78+
with:
79+
app_id: ${{ secrets.BUFBUILD_ISSUE_CREATOR_APP_ID }}
80+
private_key: ${{ secrets.BUFBUILD_ISSUE_CREATOR_APP_KEY }}
81+
permissions: >-
82+
{"issues": "write"}
7483
- uses: dblock/create-a-github-issue@c5e54b8762a0c4c2cd9330750e30b81bcc369c38
75-
if: failure()
84+
if: ${{ failure() }}
7685
env:
77-
GITHUB_TOKEN: ${{ github.token }}
86+
GITHUB_TOKEN: ${{ steps.generate_issues_token.outputs.token }}
7887
GITHUB_SERVER_URL: ${ github.server_url }}
7988
GITHUB_REPOSITORY: ${{ github.repository }}
8089
GITHUB_RUN_ID: ${{ github.run_id }}

.github/workflows/release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,19 @@ jobs:
4747
if: always()
4848
run: |
4949
rm -fv minisign.key
50+
- name: Generate Github Token
51+
id: generate_issues_token
52+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
53+
if: ${{ failure() }}
54+
with:
55+
app_id: ${{ secrets.BUFBUILD_ISSUE_CREATOR_APP_ID }}
56+
private_key: ${{ secrets.BUFBUILD_ISSUE_CREATOR_APP_KEY }}
57+
permissions: >-
58+
{"issues": "write"}
5059
- uses: dblock/create-a-github-issue@c5e54b8762a0c4c2cd9330750e30b81bcc369c38
51-
if: failure()
60+
if: ${{ failure() }}
5261
env:
53-
GITHUB_TOKEN: ${{ github.token }}
62+
GITHUB_TOKEN: ${{ steps.generate_issues_token.outputs.token }}
5463
GITHUB_SERVER_URL: ${ github.server_url }}
5564
GITHUB_REPOSITORY: ${{ github.repository }}
5665
GITHUB_RUN_ID: ${{ github.run_id }}

.github/workflows/upload.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
uses: google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935
4242
with:
4343
workload_identity_provider: projects/491113660045/locations/global/workloadIdentityPools/plugins-workload-pool/providers/plugins-workload-provider
44-
service_account: buf-plugins-1-bufbuild-plugins@buf-plugins-1.iam.gserviceaccount.com
44+
service_account: buf-plugins-1-bufbuild-plugins@buf-plugins-1.iam.gserviceaccount.com
4545
- name: Setup gcloud
4646
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a
4747
- name: Download Plugins
@@ -51,10 +51,19 @@ jobs:
5151
go run ./cmd/download-plugins -since ${{ inputs.since }} downloads
5252
- name: Upload To Release Bucket
5353
run: gsutil -m rsync -r downloads gs://buf-plugins
54+
- name: Generate Github Token
55+
id: generate_issues_token
56+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
57+
if: ${{ failure() }}
58+
with:
59+
app_id: ${{ secrets.BUFBUILD_ISSUE_CREATOR_APP_ID }}
60+
private_key: ${{ secrets.BUFBUILD_ISSUE_CREATOR_APP_KEY }}
61+
permissions: >-
62+
{"issues": "write"}
5463
- uses: dblock/create-a-github-issue@c5e54b8762a0c4c2cd9330750e30b81bcc369c38
55-
if: failure()
64+
if: ${{ failure() }}
5665
env:
57-
GITHUB_TOKEN: ${{ github.token }}
66+
GITHUB_TOKEN: ${{ steps.generate_issues_token.outputs.token }}
5867
GITHUB_SERVER_URL: ${ github.server_url }}
5968
GITHUB_REPOSITORY: ${{ github.repository }}
6069
GITHUB_RUN_ID: ${{ github.run_id }}

0 commit comments

Comments
 (0)