Skip to content

Commit d6111a2

Browse files
authored
Merge pull request #20322 from Homebrew/vendor-gems-dependabot
workflows/vendor-gems: push to PRs from dependabot.
2 parents 00c528b + aaefb35 commit d6111a2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/vendor-gems.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
required: true
1919

2020
permissions:
21-
contents: read
21+
contents: write
2222
pull-requests: read
2323

2424
defaults:
@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Check out pull request
5454
id: checkout
55-
if: github.event_name == 'workflow_dispatch'
55+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot')
5656
run: |
5757
gh pr checkout "${PR}"
5858
@@ -68,7 +68,7 @@ jobs:
6868

6969
- name: Vendor Gems
7070
run: |
71-
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]
71+
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" || ("${GITHUB_EVENT_NAME}" == "pull_request" && "${GITHUB_ACTOR}" == "dependabot") ]]
7272
then
7373
brew vendor-gems --non-bundler-gems
7474
else
@@ -79,7 +79,7 @@ jobs:
7979
run: brew typecheck --update
8080

8181
- name: Commit RBI changes
82-
if: github.event_name == 'workflow_dispatch'
82+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot')
8383
env:
8484
GEM_NAME: ${{ steps.checkout.outputs.gem_name }}
8585
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
@@ -100,10 +100,10 @@ jobs:
100100
private-key: ${{ secrets.BREW_COMMIT_APP_KEY }}
101101

102102
- name: Push to pull request
103-
if: github.event_name == 'workflow_dispatch'
103+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot')
104104
uses: Homebrew/actions/git-try-push@main
105105
with:
106-
token: ${{ steps.app-token.outputs.token }}
106+
token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
107107
directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
108108
branch: ${{ steps.checkout.outputs.branch }}
109109
force: true

0 commit comments

Comments
 (0)