🔄 synced file(s) with PaddleHQ/go-library-template #86
Workflow file for this run
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
| # DO NOT EDIT: This file should only be modified in the `go-library-template` repo. | |
| name: Ensure code can build | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| actions: write # required for `workflow-dispatch` to trigger the automerge workflow | |
| contents: read | |
| jobs: | |
| check_build: | |
| name: Ensure code can build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: ./.github/actions/setup-go | |
| id: setup-go | |
| with: | |
| owner: ${{ github.repository_owner }} | |
| private: ${{ github.event.repository.private }} | |
| private-key: ${{ secrets.PRIVATE_GO_CI_PRIVATE_KEY }} | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Automerge | |
| uses: ./.github/actions/trigger-automerge | |
| with: | |
| event: ${{ toJSON(github.event) }} | |
| hasAutoApproverPrivateKey: ${{ secrets.AUTO_APPROVER_PRIVATE_KEY != '' }} |