Skip to content

Commit

Permalink
Merge pull request #36 from pactflow/feat/support-publishing-with-bui…
Browse files Browse the repository at this point in the history
…ld-url

feat: set --build-url when publishing pacts and provider contracts
  • Loading branch information
YOU54F authored Oct 19, 2023
2 parents 3dcdf91 + 8f5ddd4 commit 19633d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion publish-pact-files/publishPactfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ if [ ${#MISSING[@]} -gt 0 ]; then
fi

branch=$(git rev-parse --abbrev-ref HEAD)
build_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"

echo """
PACT_BROKER_BASE_URL: $PACT_BROKER_BASE_URL
PACT_BROKER_TOKEN: $PACT_BROKER_TOKEN
version: $version
pactfiles: $pactfiles
branch: $branch
build_url: $build_url
"""

docker run --rm \
Expand All @@ -31,4 +33,5 @@ docker run --rm \
publish \
$pactfiles \
--consumer-app-version $version \
--branch $branch
--branch $branch \
--build-url $build_url
5 changes: 4 additions & 1 deletion publish-provider-contract/publishOAS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ EXIT_CODE=${EXIT_CODE:-0}
REPORT_FILE_CONTENT_TYPE=${REPORT_FILE_CONTENT_TYPE:-'text/plain'}
VERIFIER_TOOL=${VERIFIER_TOOL:-'github-actions'}
BRANCH=${GITHUB_REF#refs/heads/}
BUILD_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"

echo """
URL: $URL
Expand All @@ -26,6 +27,7 @@ oas_file: $oas_file
results_file: $results_file
EXIT_CODE: $EXIT_CODE
BRANCH: $BRANCH
BUILD_URL: $BUILD_URL
"""

docker run --rm \
Expand All @@ -43,4 +45,5 @@ docker run --rm \
--verification-exit-code=$EXIT_CODE \
--verification-results $results_file \
--verification-results-content-type $REPORT_FILE_CONTENT_TYPE \
--verifier $VERIFIER_TOOL
--verifier $VERIFIER_TOOL \
--build-url $BUILD_URL

0 comments on commit 19633d2

Please sign in to comment.