Skip to content

Commit

Permalink
chore: comments and test if secrets available
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeerick committed Jun 20, 2024
1 parent 1256fe6 commit 6ee6d75
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
pull_request:

jobs:
# This job is necessary as repo secrets are not availble in jobs run
# in pull requests from forks, thus preview-web will fail.
check-permissions:
runs-on: ubuntu-latest
outputs:
Expand All @@ -24,13 +26,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

action-debug:
needs: [check-permissions]
runs-on: ubuntu-latest
steps:
- run: |
echo ${{ needs.check-permissions.outputs.checkout-priv }}
lint:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -170,8 +165,8 @@ jobs:
os: [macos-latest, ubuntu-20.04, windows-latest]

steps:
- name: Checkout using PR head
if: ${{ needs.check-permissions.outputs.checkout-priv == 'true' }}
- name: Checkout using PR head if sufficent permissions
if: ${{ github.event_name == 'pull_request' && needs.check-permissions.outputs.checkout-priv == 'true'}}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -375,6 +370,15 @@ jobs:
name: storybook-static
path: build/renderer/storybook

- name: Check if secrets are available
run: |
if [[ "${{ secrets.MY_TEST_SECRET }}" == "xval" ]]; then
echo "Access to secrets"
else
echo "No access to secrets"
exit 1
fi
- name: Deploy preview
id: cloudflare-preview
uses: cloudflare/wrangler-action@v3
Expand Down

0 comments on commit 6ee6d75

Please sign in to comment.