-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from pulumiverse/refactor/pull-request-workflow
refactor: changing the Pull Requerst workflow to handle pull_request_target event properly
- Loading branch information
Showing
1 changed file
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | ||
env: | ||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
|