Skip to content

Update actions/setup-go digest to f111f33 #200

Update actions/setup-go digest to f111f33

Update actions/setup-go digest to f111f33 #200

Workflow file for this run

name: lint-test
on: [push]
permissions:
contents: read
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
- name: golangci-lint
uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6
with:
version: latest
- name: Install dependencies
run: go get .
- name: Build
run: shellcheck **/*.sh
- name: Build
run: go build
- name: Test with the Go CLI
run: go test -v ./...
build-push:
needs: [lint-test]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # v4
- name: Extract branch name
shell: bash
run: |-
BRANCH=$(echo "${GITHUB_REF#refs/heads/}" | sed 's/[^a-zA-Z0-9._-]//g' | awk '{print substr($0, length($0)-120)}')
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
id: extract_branch
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f' # v2
with:
workload_identity_provider: ${{ secrets.GCLOUD_OIDC_POOL }}
create_credentials_file: true
service_account: ${{ secrets.GSA }}
token_format: 'access_token'
- uses: 'docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567' # v3
name: 'Docker login'
with:
registry: 'us-docker.pkg.dev'
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
- name: Build and push
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6
with:
context: .
push: true
tags: |
us-docker.pkg.dev/${{ secrets.GCLOUD_PROJECT }}/public/fabricator:${{steps.extract_branch.outputs.branch}}