File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 11name : Testinfra Test Only
2+
3+ permissions :
4+ contents : read
5+ id-token : write
6+
27on :
38 workflow_dispatch :
49 inputs :
1722 runs-on : ubuntu-latest
1823 steps :
1924 - uses : actions/checkout@v4
20- - name : Configure AWS credentials
21- uses : aws-actions/configure-aws-credentials@v4
22- with :
23- role-to-assume : arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-role
24- aws-region : ${{ env.AWS_REGION }}
2525 - name : Run tests
2626 timeout-minutes : 10
2727 env :
Original file line number Diff line number Diff line change 870870 # Get current repository name
871871 REPO=$(git remote get-url origin | sed -E 's/.*github.com[:/](.*)\.git/\1/')
872872
873+ # Check AWS credentials
874+ if [ -z "${ AWS_VAULT :- } " ]; then
875+ echo "Error: AWS_VAULT environment variable must be set with the profile name"
876+ echo "Usage: aws-vault exec supabase-dev -- nix run .#run-testinfra <ami-name> [branch]"
877+ exit 1
878+ fi
879+
873880 # Trigger the workflow with the AMI name
874881 echo "Triggering testinfra-only workflow for AMI: $AMI_NAME on branch: $BRANCH"
875882 gh workflow run testinfra-only.yml --ref "$BRANCH" -f ami_name="$AMI_NAME"
879886 sleep 5
880887
881888 # Get the latest run ID for this workflow
882- RUN_ID=$(gh run list --workflow=testinfra-only.yml --branch "$BRANCH" --limit 1 --json databaseId --jq '.[0].databaseId')
889+ RUN_ID=$(gh run list --workflow=testinfra-only.yml --branch "$BRANCH" --limit 1 --json databaseId --jq '.[0].databaseId')
883890
884891 if [ -z "$RUN_ID" ]; then
885892 echo "Error: Could not find workflow run ID"
893900
894901 # Try to watch the run, but handle network errors gracefully
895902 while true; do
896- if gh run watch "$RUN_ID" --repo "$REPO" -- exit-status; then
903+ if gh run watch "$RUN_ID" --exit-status; then
897904 break
898905 else
899906 echo "Network error while watching workflow. Retrying in 5 seconds..."
900- echo "You can also check the status manually with: gh run view $RUN_ID --repo $REPO "
907+ echo "You can also check the status manually with: gh run view $RUN_ID"
901908 sleep 5
902909 fi
903910 done
You can’t perform that action at this time.
0 commit comments