This action uses pact-cli docker image to perform an opinionated "can I deploy" check:
$ pact broker can-i-deploy --pacticipant <PACTICIPANT> --version <COMMIT_SHA> --to <ENVIRONMENT>
Action inputs are (hopefully) kept in sync with relation option of can-i-deploy
command from pact-cli
NOTE
version
andtag
are mutually exclusive. If not set, the command executed will becan-i-deploy --latest
Required The pacticipant name.
Required The tag that represents the branch or environment of the integrated applications for which you want to check the verification result status.
The pacticipant version. The command executed will be can-i-deploy --version <version>
The pacticipant tag. The command executed will be can-i-deploy --latest <tag>
Setup environment variable used by pact-cli
.
Required The base URL of the Pact Broker
Required Pact Broker basic auth username
Required Pact Broker basic auth password
steps:
# ...
- uses: casavo/pact-can-i-deploy-action@v1
env:
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }}
PACT_BROKER_PASSWORD: ${{ secrets.PACT_BROKER_PASSWORD }}
PACT_BROKER_USERNAME: ${{ secrets.PACT_BROKER_USERNAME }}
with:
pacticipant: my-application
version: ${{ github.sha }}
to: staging
# ...