Use this GitHub Action to tag any consumers of a provider when a release branch is cut for the provider. These tags can then be used by the provider when determining which pacts to verify when CI runs on the release branch.
Create a step within a workflow using this action:
- name: Run Budget
uses: "appfolio/pact-release-tagger@v0"
with:
RELEASE_BRANCH: ${{github.ref_name}}
PACT_BROKER_URL: https://[yourbroker].pactflow.io
PACT_PROVIDER: SomeApp API
PACT_TOKEN: ${{secrets.PACT_TOKEN}}
Assuming the above configuration with RELEASE_BRANCH: 20220915
, after running successfully each consumer version will be tagged in the following format:
someapp_api-20220915
yarn
yarn run build
You can test locally prepending INPUT_
to each env variable, e.g.
INPUT_PACT_TOKEN=**** INPUT_PACT_PROVIDER="Property API" INPUT_RELEASE_BRANCH=20220915 INPUT_PACT_BROKER_URL=https://broker.pactflow.io node dist/index.js
See Creating a composite action for how to tag and use a new version.