Skip to content

Commit

Permalink
Don't publish pact from branches
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin committed Jan 25, 2025
1 parent e5d524a commit 13f5b3c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,24 @@ jobs:
- run: make test-unit

make-pact-tests:
env:
PACT_VERSION: ${{ github.sha }}
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.22'
- uses: replicatedhq/action-install-pact@v1
- name: setup pact environment
run: |
if [[ $GITHUB_REF_NAME == 'main' ]]; then
echo "PACT_VERSION=${{ github.sha }}" >> "$GITHUB_ENV"
echo "PACT_BROKER_BASE_URL=${{ secrets.PACT_BROKER_BASE_URL }}" >> "$GITHUB_ENV"
echo "PACT_BROKER_TOKEN=${{ secrets.PACT_BROKER_TOKEN }}" >> "$GITHUB_ENV"
fi
- run: make test-pact
- if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository )
- if: ${{ github.ref == 'refs/heads/main' }} && ( github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository ) )
run: make publish-pact
- if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository )
- if: ${{ github.ref == 'refs/heads/main' }} && ( github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository ) )
run: |
make can-i-deploy || echo "::warning:: can-i-deploy says no; provider(s) must successfully verify before release"
Expand Down

0 comments on commit 13f5b3c

Please sign in to comment.