Skip to content

Wrap errors with %w #190

Wrap errors with %w

Wrap errors with %w #190

Workflow file for this run

name: ci
on:
pull_request:
push:
branches:
- main
tags:
- v*
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: go mod download
- run: go test -cpu=1,2 -race ./...
image:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v3
- uses: docker/metadata-action@v5
id: docker_meta
with:
images: docker.io/arbourd/concourse-slack-alert-resource,ghcr.io/arbourd/concourse-slack-alert-resource
tags: |
type=edge
type=semver,pattern={{raw}}
flavor: |
latest=auto
- name: Build test image
uses: docker/build-push-action@v5
with:
cache-from: type=gha
load: true
push: false
tags: concourse-slack-alert-resource:dev
- run: >
echo "{\"source\":{\"url\":\"${{ vars.SLACK_WEBHOOK }}\"}}" | docker run -i
-e "BUILD_TEAM_NAME=main"
-e "BUILD_PIPELINE_NAME=github-actions"
-e "BUILD_JOB_NAME=test"
-e "BUILD_NAME=$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER"
-e "BUILD_PIPELINE_INSTANCE_VARS={\"ref\":\"$GITHUB_REF_NAME\"}"
concourse-slack-alert-resource:dev
/opt/resource/out $PWD
- if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: docker.io
username: arbourd
password: ${{ secrets.DOCKER_TOKEN }}
- if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish image
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}