Skip to content

Commit

Permalink
build: define pact env vars in config
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaoste committed Jun 24, 2024
1 parent 759999c commit 99c44f5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ on:
secrets:
NPM_TOKEN:
required: true
PACT_BROKER_BASE_URL:
required: true
PACT_BROKER_TOKEN:
required: true

env:
GIT_COMMIT: ${{ github.sha }}
GIT_REF: ${{ github.ref }}

jobs:
# this job relies on the install-build workflow to run first
Expand Down Expand Up @@ -56,10 +64,12 @@ jobs:
- name: Run CT Tests
run: npm run test:component
- name: Publish pacts between Experiences SDK and User Interface
run: GIT_BRANCH=${GIT_REF:11} docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli publish ${PWD}/pacts --consumer-app-version ${GIT_COMMIT} --branch ${GIT_BRANCH}
run: echo $GIF_REF && echo $GIT_COMMIT && echo $PACT_BROKER_BASE_URL && GIT_BRANCH=${GIT_REF:11} docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli publish ${PWD}/pacts --consumer-app-version ${GIT_COMMIT} --branch ${GIT_BRANCH}
env:
PACT_BROKER_BASE_URL: ${{ env.PACT_BROKER_BASE_URL }}
PACT_BROKER_TOKEN: ${{ env.PACT_BROKER_TOKEN }}
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
GIT_COMMIT: ${{ env.GIT_COMMIT }}
GIT_REF: ${{ env.GIT_REF }}
# TODO: Record releases
- name: Save test results to artifact
uses: actions/upload-artifact@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
uses: ./.github/workflows/check.yaml
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
publish:
needs: [install-build, check]
if: >-
Expand Down

0 comments on commit 99c44f5

Please sign in to comment.