Use GITHUB_TOKEN more consistently.
https://docs.github.com/en/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token This provides enough permissions for almost everything we want to do. When it's not enough (e.g. for `brew update-maintainers`): generate a dedicated, repo-specific token for when increased scopes are needed and setup a new organisation-wide token on the new PAT format.
This commit is contained in:
parent
d58e06ceca
commit
d837d5cdf4
4
.github/workflows/sorbet.yml
vendored
4
.github/workflows/sorbet.yml
vendored
@ -61,7 +61,7 @@ jobs:
|
|||||||
if: steps.update.outputs.committed == 'true'
|
if: steps.update.outputs.committed == 'true'
|
||||||
uses: Homebrew/actions/git-try-push@master
|
uses: Homebrew/actions/git-try-push@master
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
|
||||||
branch: ${{ steps.update.outputs.branch }}
|
branch: ${{ steps.update.outputs.branch }}
|
||||||
force: true
|
force: true
|
||||||
origin_branch: "master"
|
origin_branch: "master"
|
||||||
@ -70,4 +70,4 @@ jobs:
|
|||||||
if: steps.update.outputs.pull_request == 'true'
|
if: steps.update.outputs.pull_request == 'true'
|
||||||
run: hub pull-request --no-edit
|
run: hub pull-request --no-edit
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
|
||||||
|
6
.github/workflows/spdx.yml
vendored
6
.github/workflows/spdx.yml
vendored
@ -29,8 +29,6 @@ jobs:
|
|||||||
- name: Update SPDX license data
|
- name: Update SPDX license data
|
||||||
id: update
|
id: update
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
|
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
|
||||||
run: |
|
run: |
|
||||||
git fetch origin
|
git fetch origin
|
||||||
@ -59,7 +57,7 @@ jobs:
|
|||||||
if: steps.update.outputs.committed == 'true'
|
if: steps.update.outputs.committed == 'true'
|
||||||
uses: Homebrew/actions/git-try-push@master
|
uses: Homebrew/actions/git-try-push@master
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
|
||||||
branch: ${{ steps.update.outputs.branch }}
|
branch: ${{ steps.update.outputs.branch }}
|
||||||
force: true
|
force: true
|
||||||
origin_branch: "master"
|
origin_branch: "master"
|
||||||
@ -68,4 +66,4 @@ jobs:
|
|||||||
if: steps.update.outputs.pull_request == 'true'
|
if: steps.update.outputs.pull_request == 'true'
|
||||||
run: hub pull-request --no-edit
|
run: hub pull-request --no-edit
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
|
||||||
|
4
.github/workflows/triage-issues.yml
vendored
4
.github/workflows/triage-issues.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
|||||||
- name: Mark/Close Stale Issues and Pull Requests
|
- name: Mark/Close Stale Issues and Pull Requests
|
||||||
uses: actions/stale@v3
|
uses: actions/stale@v3
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
repo-token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
|
||||||
days-before-stale: 21
|
days-before-stale: 21
|
||||||
days-before-close: 7
|
days-before-close: 7
|
||||||
stale-issue-message: >
|
stale-issue-message: >
|
||||||
@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Lock Outdated Threads
|
- name: Lock Outdated Threads
|
||||||
uses: dessant/lock-threads@486f7380c15596f92b724e4260e4981c68d6bde6
|
uses: dessant/lock-threads@486f7380c15596f92b724e4260e4981c68d6bde6
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
issue-lock-inactive-days: 30
|
issue-lock-inactive-days: 30
|
||||||
issue-lock-labels: outdated
|
issue-lock-labels: outdated
|
||||||
pr-lock-inactive-days: 30
|
pr-lock-inactive-days: 30
|
||||||
|
4
.github/workflows/triage.yml
vendored
4
.github/workflows/triage.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
if: github.event_name == 'schedule' || github.event.action == 'closed'
|
if: github.event_name == 'schedule' || github.event.action == 'closed'
|
||||||
uses: reitermarkus/rerun-workflow@64cba9e834916060e77b7dad424d086837fdd0a6
|
uses: reitermarkus/rerun-workflow@64cba9e834916060e77b7dad424d086837fdd0a6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
|
||||||
continuous-label: waiting for feedback
|
continuous-label: waiting for feedback
|
||||||
trigger-labels: critical
|
trigger-labels: critical
|
||||||
workflow: triage.yml
|
workflow: triage.yml
|
||||||
@ -31,7 +31,7 @@ jobs:
|
|||||||
github.event.action != 'closed' && github.event.pull_request.state != 'closed'
|
github.event.action != 'closed' && github.event.pull_request.state != 'closed'
|
||||||
uses: actions/github-script@v3
|
uses: actions/github-script@v3
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
github-token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
async function approvePullRequest(pullRequestNumber) {
|
async function approvePullRequest(pullRequestNumber) {
|
||||||
const reviews = await approvalsByAuthenticatedUser(pullRequestNumber)
|
const reviews = await approvalsByAuthenticatedUser(pullRequestNumber)
|
||||||
|
6
.github/workflows/update-manpage.yml
vendored
6
.github/workflows/update-manpage.yml
vendored
@ -69,14 +69,14 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_BREW_UPDATE_MAINTAINERS_TOKEN }}
|
||||||
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
|
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
|
||||||
|
|
||||||
- name: Push commits
|
- name: Push commits
|
||||||
if: steps.update.outputs.committed == 'true'
|
if: steps.update.outputs.committed == 'true'
|
||||||
uses: Homebrew/actions/git-try-push@master
|
uses: Homebrew/actions/git-try-push@master
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
|
||||||
branch: ${{ steps.update.outputs.branch }}
|
branch: ${{ steps.update.outputs.branch }}
|
||||||
force: true
|
force: true
|
||||||
origin_branch: "master"
|
origin_branch: "master"
|
||||||
@ -85,4 +85,4 @@ jobs:
|
|||||||
if: steps.update.outputs.pull_request == 'true'
|
if: steps.update.outputs.pull_request == 'true'
|
||||||
run: hub pull-request --no-edit
|
run: hub pull-request --no-edit
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
|
||||||
|
4
.github/workflows/vendor-gems.yml
vendored
4
.github/workflows/vendor-gems.yml
vendored
@ -43,7 +43,7 @@ jobs:
|
|||||||
gem_name="$(echo "${branch}" | sed -E 's|.*/||;s|(.*)-.*$|\1|')"
|
gem_name="$(echo "${branch}" | sed -E 's|.*/||;s|(.*)-.*$|\1|')"
|
||||||
echo "::set-output name=gem_name::${gem_name}"
|
echo "::set-output name=gem_name::${gem_name}"
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Vendor Gems
|
- name: Vendor Gems
|
||||||
env:
|
env:
|
||||||
GEM_NAME: ${{ steps.checkout.outputs.gem_name }}
|
GEM_NAME: ${{ steps.checkout.outputs.gem_name }}
|
||||||
@ -73,6 +73,6 @@ jobs:
|
|||||||
- name: Push to pull request
|
- name: Push to pull request
|
||||||
uses: Homebrew/actions/git-try-push@master
|
uses: Homebrew/actions/git-try-push@master
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
|
||||||
branch: ${{ steps.checkout.outputs.branch }}
|
branch: ${{ steps.checkout.outputs.branch }}
|
||||||
force: true
|
force: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user