Merge pull request #17718 from Homebrew/vendor-gems-no-pull-request-target
This commit is contained in:
commit
b9da669ef2
25
.github/workflows/vendor-gems.yml
vendored
25
.github/workflows/vendor-gems.yml
vendored
@ -10,7 +10,6 @@ on:
|
|||||||
- .github/workflows/vendor-gems.yml
|
- .github/workflows/vendor-gems.yml
|
||||||
branches-ignore:
|
branches-ignore:
|
||||||
- master
|
- master
|
||||||
pull_request_target:
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
pull_request:
|
pull_request:
|
||||||
@ -23,15 +22,7 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
vendor-gems:
|
vendor-gems:
|
||||||
if: >
|
if: github.repository_owner == 'Homebrew'
|
||||||
github.repository_owner == 'Homebrew' && (
|
|
||||||
github.event_name == 'workflow_dispatch' ||
|
|
||||||
github.event_name == 'pull_request' ||
|
|
||||||
github.event_name == 'push' || (
|
|
||||||
github.event.pull_request.user.login == 'dependabot[bot]' &&
|
|
||||||
contains(github.event.pull_request.title, '/Library/Homebrew')
|
|
||||||
)
|
|
||||||
)
|
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Homebrew
|
- name: Set up Homebrew
|
||||||
@ -43,20 +34,20 @@ jobs:
|
|||||||
test-bot: false
|
test-bot: false
|
||||||
|
|
||||||
- name: Configure Git user
|
- name: Configure Git user
|
||||||
if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
uses: Homebrew/actions/git-user-config@master
|
uses: Homebrew/actions/git-user-config@master
|
||||||
with:
|
with:
|
||||||
username: BrewTestBot
|
username: BrewTestBot
|
||||||
|
|
||||||
- name: Set up commit signing
|
- name: Set up commit signing
|
||||||
if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
uses: Homebrew/actions/setup-commit-signing@master
|
uses: Homebrew/actions/setup-commit-signing@master
|
||||||
with:
|
with:
|
||||||
signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }}
|
signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }}
|
||||||
|
|
||||||
- name: Check out pull request
|
- name: Check out pull request
|
||||||
id: checkout
|
id: checkout
|
||||||
if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
run: |
|
run: |
|
||||||
gh pr checkout "${PR}"
|
gh pr checkout "${PR}"
|
||||||
|
|
||||||
@ -74,7 +65,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
|
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
|
||||||
run: |
|
run: |
|
||||||
if [[ "${GITHUB_EVENT_NAME}" == "pull_request_target" || "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]
|
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]
|
||||||
then
|
then
|
||||||
brew vendor-gems --non-bundler-gems
|
brew vendor-gems --non-bundler-gems
|
||||||
else
|
else
|
||||||
@ -85,7 +76,7 @@ jobs:
|
|||||||
run: brew typecheck --update
|
run: brew typecheck --update
|
||||||
|
|
||||||
- name: Commit RBI changes
|
- name: Commit RBI changes
|
||||||
if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
env:
|
env:
|
||||||
GEM_NAME: ${{ steps.checkout.outputs.gem_name }}
|
GEM_NAME: ${{ steps.checkout.outputs.gem_name }}
|
||||||
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
|
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
|
||||||
@ -101,13 +92,13 @@ jobs:
|
|||||||
- name: Generate push token
|
- name: Generate push token
|
||||||
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1
|
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1
|
||||||
id: app-token
|
id: app-token
|
||||||
if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
with:
|
with:
|
||||||
app-id: ${{ vars.BREW_COMMIT_APP_ID }}
|
app-id: ${{ vars.BREW_COMMIT_APP_ID }}
|
||||||
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 == 'pull_request_target' || github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
uses: Homebrew/actions/git-try-push@master
|
uses: Homebrew/actions/git-try-push@master
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.app-token.outputs.token }}
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user