Skip to content

Commit

Permalink
ci: use correct token to wait for codespace
Browse files Browse the repository at this point in the history
  • Loading branch information
rjaegers committed Nov 7, 2024
1 parent 86a600d commit 7067274
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/acceptance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
persist-credentials: false
# Create a GitHub Codespace and communicate the image version via a Codespace secret (should be a Codespace environment variable).
# This secret is used by devcontainer.json, as such it is a resource that should not be used concurrently.
- run: |
- name: Start Codespace
run: |
set -Eeuo pipefail
gh secret set -a codespaces IMAGE_VERSION --body "pr-${{ github.event.pull_request.number }}"
echo CODESPACE_NAME="$(gh codespace create -R "${{ github.repository }}" -b "$HEAD_REF" -m basicLinux32gb --devcontainer-path ".devcontainer/${{ inputs.flavor }}-test/devcontainer.json" --idle-timeout 10m --retention-period 1h)" >> "$GITHUB_ENV"
Expand All @@ -39,13 +40,13 @@ jobs:
node-version: 20
- run: npm ci
- run: npx playwright install --with-deps
- run: |
- name: Wait for Codespace to be active
run: |
set -Eeuo pipefail
MAX_WAIT_SECONDS=$((3 * 60))
SECONDS_ELAPSED=0
# Wait for the Codespace to be active
while true; do
STATE=$(gh codespace list --json name,state --jq ".[] | select(.name == \"$CODESPACE_NAME\") | .state")
echo "Current state: $STATE"
Expand All @@ -60,6 +61,8 @@ jobs:
sleep 5
SECONDS_ELAPSED=$((SECONDS_ELAPSED + 5))
done
env:
GH_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
- run: cd test/${{ inputs.flavor }}/features && npm test
env:
GITHUB_USER: ${{ secrets.TEST_GITHUB_USER }}
Expand Down

0 comments on commit 7067274

Please sign in to comment.