Skip to content

Commit

Permalink
Ensure Trusted Code Checkout in GitHub Actions Workflow (#7034)
Browse files Browse the repository at this point in the history
* feat: Ensure Trusted Code Checkout in GitHub Actions Workflow

* fix: update GitHub event name
  • Loading branch information
UlisesGascon authored Sep 16, 2024
1 parent d9e0865 commit ae06243
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event.pull_request.head.sha || github.ref }}
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
# We only need to fetch the last commit from the head_ref
# since we're not using the `--filter` operation from turborepo
# We don't use the `--filter` as we always want to force builds regardless of having changes or not
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event.pull_request.head.sha || github.ref }}
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}

- name: Add Comment to PR
# Signal that a lighthouse run is about to start
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event.pull_request.head.sha || github.ref }}
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}

- name: Restore Lint Cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event.pull_request.head.sha || github.ref }}
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
# The Chromatic (@chromaui/action) Action requires a full history of the current branch in order to be able to compare
# previous changes and previous commits and determine which Storybooks should be tested against and what should be built
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/translations-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event.pull_request.head.sha || github.ref }}
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}

- name: Restore Lint Cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand Down

0 comments on commit ae06243

Please sign in to comment.