Skip to content

Wire up deleteColumn for WDS (#4605) #374

Wire up deleteColumn for WDS (#4605)

Wire up deleteColumn for WDS (#4605) #374

name: Publish Pacts
on:
workflow_dispatch:
push:
branches: [ dev ]
jobs:
setup-and-test:
runs-on: ubuntu-latest
outputs:
pact-b64: ${{ steps.encode.outputs.pact-b64 }}
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: |
yarn install
- name: Run tests
run: yarn test "\b\w*Pact\w*\.test\.(js|ts)\b" # This matches any test file that contains the word "Pact" at the end of its name, either js or ts.
- name: Encode the pact as non-breaking base 64 string
id: encode
env:
PACT_FULL_PATH: 'pacts/terra-ui-cbas.json' # Currently, workflows are limited to a single Pact file (see WM-1858).
run: |
NON_BREAKING_B64=$(cat $PACT_FULL_PATH | base64 -w 0)
echo "pact-b64=${NON_BREAKING_B64}" >> $GITHUB_OUTPUT
echo $NON_BREAKING_B64
publish-pact-workflow:
runs-on: ubuntu-latest
needs: [setup-and-test]
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Publish Pact contracts
uses: aurelien-baudet/workflow-dispatch@93e95b157d791ae7f42aef8f8a0d3d723eba1c31 #commit sha for v2.1.1
with:
workflow: publish-contracts.yaml
repo: broadinstitute/terra-github-workflows
ref: refs/heads/main
token: ${{ secrets.BROADBOT_TOKEN}} # github token for access to kick off a job in the private repo
inputs: '{ "pact-b64": "${{ needs.setup-and-test.outputs.pact-b64 }}", "repo-owner": "DataBiosphere", "repo-name": "terra-ui", "repo-branch": "dev" }'