Skip to content

Commit

Permalink
ci: skip steps from forks if no token (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdehaven authored Dec 8, 2024
1 parent a2e7d53 commit 1871c59
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ jobs:
name: Run Tests
runs-on: ubuntu-latest
timeout-minutes: 20
env:
GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }}
steps:
- name: Remove preview consumption comment
if: github.event_name == 'pull_request'
if: ${{ github.event_name == 'pull_request' && env.GITHUB_TOKEN != '' }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr_preview_consumption
delete: true
GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }}
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -96,7 +98,7 @@ jobs:
echo "EOF" >> $GITHUB_OUTPUT
- name: Provide preview link info
if: ${{ steps.package-preview.outputs.npm_instructions != '' }}
if: ${{ steps.package-preview.outputs.npm_instructions != '' && env.GITHUB_TOKEN != '' }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr_preview_consumption
Expand All @@ -108,4 +110,4 @@ jobs:
```sh
${{ steps.package-preview.outputs.npm_instructions }}
```
GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }}
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}

0 comments on commit 1871c59

Please sign in to comment.