Skip to content

Commit

Permalink
[CI / OAS] Use 'pull_request_target' for Bump action
Browse files Browse the repository at this point in the history
In order for the Bump.sh action to be able to post github comments on
PRs opened from forks, the GH action needs to listen to the
'pull_request_target' event (instead of the 'pull_request' event).

More details about the introduction of this event in this GH blog
post:
https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/

Complete documentation about this event:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
  • Loading branch information
paulRbr committed Jun 26, 2024
1 parent a493e40 commit ac1bdc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
paths:
- 'oas_docs/kibana.serverless.yaml'

pull_request:
pull_request_target:
branches:
- main
paths:
Expand All @@ -33,7 +33,7 @@ jobs:
file: oas_docs/kibana.serverless.yaml

api-diff:
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request_target' }}
name: Check API diff on Bump.sh
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit ac1bdc0

Please sign in to comment.