Hello, an other question about the integration int...
# pact-go
c
Hello, an other question about the integration into the CI/CD pipeline: I'm currently trying to create a workflow to generate and publish my contract into my broker
Copy code
name: Build

on:
  push:
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v4
        with:
            go-version: 1.21.4

      - name: change folder
        run: cd /opt
      - name: pact broker cli
        run: |
            mkdir -p $HOME/pact/bin
            curl -fsSL <https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh> | bash -s -- -b $HOME/pact/bin
      - name: path
        run: export export PATH=$PATH:$HOME/pact/bin
      - name: instal pact
        run: go install github.com/pact-foundation/pact-go/v2@2.x.x
      - name: path for go1
        run: export GOPATH=$HOME/go
      - name: path for go2
        run: export PATH=$PATH:$GOPATH/bin
      - name: pact version
        run: pact-go -v
      - name: Debug pact
        run: pact-go -l DEBUG install 
      - name: Test
        run: go test ./consumer

        
      - name: Publish pacts 
        run: |
            pact-broker publish consumer/pacts --consumer-app-version 1.0.0 --broker-base-url=<https://mybroker.pactflow.io> --broker-token mytoken
but I have an error of permission
m
It’s trying to write the lib to
/usr/local/lib
but that directory is not writeable
You can set the download path to one of the other locations Pact Go checks. Here is how our PactFlow terraform client does it: https://github.com/pactflow/terraform-provider-pact/blob/master/.github/workflows/test.yml#L14-L15
_(I don’t the
LD_LIBRARY_PATH
env var is actually important, but I could be wrong about that)_
c
thanks, it worked 🙂
🙌 1