Skip to content

Commit

Permalink
Merge pull request #199 from pulumiverse/refactor/pull-request-workflow
Browse files Browse the repository at this point in the history
refactor: changing the Pull Requerst workflow to handle pull_request_target event properly
  • Loading branch information
tmeckel authored Jun 13, 2024
2 parents 3ce21ab + b43c8ad commit ba180d5
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
name: Pull Request
on:
pull_request_target:
pull_request:
paths-ignore:
- '.github/workflows/provider-*.yaml'

pull_request_target:
paths:
- '01-teams'
- '02-repositories'
- '03-members'

jobs:
preview-changes:
name: Preview changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Checkout code when the event is `pull_request`
- name: Checkout code
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
# Checkout code when the event is `pull_request_target`
- name: Checkout code
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
ref: '${{ github.event.pull_request.merge_commit_sha }}'

- uses: volta-cli/action@v4

- run: npm ci

- uses: pulumi/actions@v5.2.4
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
Expand Down

0 comments on commit ba180d5

Please sign in to comment.