workflows/vendor-gems: push to PRs from dependabot.
This should avoid maintainers needing to run with `workflow_dispatch` for dependabot PRs. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
00c528bc54
commit
aaefb351b4
12
.github/workflows/vendor-gems.yml
vendored
12
.github/workflows/vendor-gems.yml
vendored
@ -18,7 +18,7 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
pull-requests: read
|
pull-requests: read
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
@ -52,7 +52,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Check out pull request
|
- name: Check out pull request
|
||||||
id: checkout
|
id: checkout
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot')
|
||||||
run: |
|
run: |
|
||||||
gh pr checkout "${PR}"
|
gh pr checkout "${PR}"
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Vendor Gems
|
- name: Vendor Gems
|
||||||
run: |
|
run: |
|
||||||
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]
|
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" || ("${GITHUB_EVENT_NAME}" == "pull_request" && "${GITHUB_ACTOR}" == "dependabot") ]]
|
||||||
then
|
then
|
||||||
brew vendor-gems --non-bundler-gems
|
brew vendor-gems --non-bundler-gems
|
||||||
else
|
else
|
||||||
@ -79,7 +79,7 @@ jobs:
|
|||||||
run: brew typecheck --update
|
run: brew typecheck --update
|
||||||
|
|
||||||
- name: Commit RBI changes
|
- name: Commit RBI changes
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot')
|
||||||
env:
|
env:
|
||||||
GEM_NAME: ${{ steps.checkout.outputs.gem_name }}
|
GEM_NAME: ${{ steps.checkout.outputs.gem_name }}
|
||||||
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
|
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
|
||||||
@ -100,10 +100,10 @@ jobs:
|
|||||||
private-key: ${{ secrets.BREW_COMMIT_APP_KEY }}
|
private-key: ${{ secrets.BREW_COMMIT_APP_KEY }}
|
||||||
|
|
||||||
- name: Push to pull request
|
- name: Push to pull request
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot')
|
||||||
uses: Homebrew/actions/git-try-push@main
|
uses: Homebrew/actions/git-try-push@main
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.app-token.outputs.token }}
|
token: ${{ steps.app-token.outputs.token || secrets.GITHUB_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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user