name: Go proxy pull

on:
  push:
    tags:
      - "v[0-9]+.[0-9]+.[0-9]+"

permissions: {}

jobs:
  go-proxy-pull:
    outputs:
      status: ${{ job.status }}
    permissions:
      contents: write
    runs-on: ubuntu-latest

    steps:
      - name: Pull new module version
        uses: andrewslotin/go-proxy-pull-action@v1.3.0
        with:
          import_path: github.com/${{ github.repository }}

  slack-notification:
    needs: [go-proxy-pull]
    if: ${{ always() && contains(fromJSON('["failure", "cancelled"]'), needs.go-proxy-pull.outputs.status) }}
    secrets:
      SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
    uses: senzing-factory/build-resources/.github/workflows/build-failure-slack-notification.yaml@v3
    with:
      job-status: ${{ needs.go-proxy-pull.outputs.status }}
