-
Notifications
You must be signed in to change notification settings - Fork 218
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 #2722 from evidence-dev/ci/fix-chromatic-trigger
Run Chromatic on correct ref, require approval before running `pull_request_target` actions
- Loading branch information
Showing
3 changed files
with
17 additions
and
3 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,19 @@ | ||
name: 'Chromatic' | ||
|
||
on: | ||
push: | ||
pull_request_target: | ||
|
||
jobs: | ||
external-pr-action-approval: | ||
uses: ./.github/workflows/external-pr-action-approval.yml | ||
chromatic: | ||
needs: external-pr-action-approval | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 8.6.9 | ||
|
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# https://datachain.ai/blog/testing-external-contributions-using-github-actions-secrets | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
external-pr-action-approval: | ||
name: 'External PR Action Approval' | ||
environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'Approval required to run action on external PR' || '' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: true |
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