Skip to content

Commit

Permalink
Add 10 second delay to check should run logic if the triggering event…
Browse files Browse the repository at this point in the history
… is a PR to allow time for a push event to register.

Add debugging output to Start Snapshot step
  • Loading branch information
jlantz committed Sep 15, 2024
1 parent aef389a commit e3763e5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/feature-test-2gp-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
run: |
# Get the commit SHA
if [[ "${{ inputs.triggering_event }}" == "pull_request" ]]; then
# Delay for 10 seconds to prevent race conditions
sleep 10
SHA="${{ github.event.pull_request.head.sha }}"
else
SHA="${{ github.sha }}"
Expand Down Expand Up @@ -152,13 +154,22 @@ jobs:
if: inputs.create_pr_snapshot == true
id: start_snapshot_creation
run: |
set -e
output=$(cci task run github_pull_request_snapshot \
--wait False \
--build-success ${{ job.status == 'success' }} \
--snapshot-is-packaged true)
--snapshot-is-packaged true) || {
echo "Snapshot creation failed."
exit 1
}
echo "$output"
snapshot_id=$(echo "$output" | grep -oP 'SNAPSHOT_ID=\K[^ ]+')
echo "SNAPSHOT_ID=$snapshot_id" >> $GITHUB_OUTPUT
if [ -n "$snapshot_id" ]; then
echo "SNAPSHOT_ID=$snapshot_id" >> $GITHUB_OUTPUT
else
echo "No SNAPSHOT_ID found in the output."
exit 1
fi
shell: bash

- name: Run Feature Test
Expand Down

0 comments on commit e3763e5

Please sign in to comment.