[OPS-1301] Use baton-ci app token in capabilities.yaml (#44) #133
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Output connector capabilities | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| calculate-capabilities: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| ports: | |
| - "5432:5432" | |
| env: | |
| POSTGRES_PASSWORD: secretpassword | |
| steps: | |
| - name: Mint baton-ci app token | |
| id: ci-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ vars.BATON_CI_CLIENT_ID }} | |
| private-key: ${{ secrets.BATON_CI_SECRET_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: ${{ github.event.repository.name }} | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.ci-token.outputs.token }} | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Build | |
| run: go build -o connector ./cmd/baton-postgresql | |
| - name: Run and save output | |
| env: | |
| BATON_DSN: 'postgres://postgres:secretpassword@localhost:5432/postgres' | |
| run: ./connector capabilities > baton_capabilities.json | |
| - name: Commit changes | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| default_author: github_actions | |
| message: 'Updating baton capabilities.' | |
| add: 'baton_capabilities.json' |