Skip to content

Commit

Permalink
Resolve race condition and related timing issues. (#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
ichengchang authored May 1, 2024
1 parent 09e280e commit 3e9873f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ on:
default: false
required: false
type: string
print-tag:
description: "Echo generated tag to console"
default: "true"
required: false
type: string
release-branches:
description: "Default branch (main, develop, etc)"
default: 'main'
Expand All @@ -30,6 +25,9 @@ on:
new-tag:
description: "The value of the newly created tag"
value: ${{ jobs.tag-job.outputs.new-tag }}
app-version:
description: "The app version"
value: ${{ jobs.tag-job.outputs.app-version }}
secrets:
BROADBOT_TOKEN:
required: true
Expand All @@ -44,6 +42,7 @@ jobs:
outputs:
tag: ${{ steps.tag.outputs.tag }}
new-tag: ${{ steps.tag.outputs.new_tag }}
app-version: ${{ steps.output-version.outputs.app-version }}
steps:
- name: Checkout current code
uses: actions/checkout@v3
Expand All @@ -60,7 +59,14 @@ jobs:
DRY_RUN: ${{ inputs.dry-run }}
RELEASE_BRANCHES: ${{ inputs.release-branches }}
WITH_V: true
- name: Echo generated tag to console
if: ${{ inputs.print-tag == 'true' }}
- name: Output app version
id: output-version
run: |
echo "Newly created version tag: '${{ steps.tag.outputs.new_tag }}'"
# See https://broadworkbench.atlassian.net/browse/QA-2282 for context
if [[ -z "${{ steps.tag.outputs.new_tag }}" ]]; then
echo "App version tag for this commit has already been dispatched: '${{ steps.tag.outputs.tag }}'"
echo "app-version=${{ steps.tag.outputs.tag }}" >> $GITHUB_OUTPUT
else
echo "New app version tag: '${{ steps.tag.outputs.new_tag }}'"
echo "app-version=${{ steps.tag.outputs.new_tag }}" >> $GITHUB_OUTPUT
fi
2 changes: 1 addition & 1 deletion .github/workflows/verify_consumer_pacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
# for publishing the results of provider verification.
if [[ -z "${{ inputs.pb-event-type }}" ]]; then
echo "PROVIDER_BRANCH=${{ env.CURRENT_BRANCH }}" >> $GITHUB_ENV
echo "PROVIDER_VERSION=${{ needs.regulated-tag-job.outputs.new-tag }}" >> $GITHUB_ENV
echo "PROVIDER_VERSION=${{ needs.regulated-tag-job.outputs.app-version }}" >> $GITHUB_ENV
else
echo "PROVIDER_VERSION=${{ env.PROVIDER_TAG }}" >> $GITHUB_ENV
fi
Expand Down

0 comments on commit 3e9873f

Please sign in to comment.