workflows/vendor-gems: trial using GitHub App token

This commit is contained in:
Bo Anderson 2023-11-22 16:53:31 +00:00
parent d7a0f299b4
commit 41d60e54a1
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
2 changed files with 12 additions and 4 deletions

View File

@ -1,8 +1,8 @@
self-hosted-runner: self-hosted-runner:
# Labels of self-hosted runner in array of strings. # Labels of self-hosted runner in array of strings.
labels: labels: []
- 11-arm64
# Configuration variables in array of strings defined in your repository or # Configuration variables in array of strings defined in your repository or
# organization. `null` means disabling configuration variables check. # organization. `null` means disabling configuration variables check.
# Empty array means no configuration variable is allowed. # Empty array means no configuration variable is allowed.
config-variables: [] config-variables:
- BREW_COMMIT_APP_ID

View File

@ -151,11 +151,19 @@ jobs:
-m "Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow." -m "Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow."
fi fi
- name: Generate push token
uses: actions/create-github-app-token@v1
id: app-token
if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch'
with:
app-id: ${{ vars.BREW_COMMIT_APP_ID }}
private-key: ${{ secrets.BREW_COMMIT_APP_KEY }}
- name: Push to pull request - name: Push to pull request
if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch'
uses: Homebrew/actions/git-try-push@master uses: Homebrew/actions/git-try-push@master
with: with:
token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }} token: ${{ steps.app-token.outputs.token }}
directory: ${{ steps.set-up-homebrew.outputs.repository-path }} directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
branch: ${{ steps.checkout.outputs.branch }} branch: ${{ steps.checkout.outputs.branch }}
force: true force: true