diff --git a/.buildkite/bump-golang.yml b/.buildkite/bump-golang.yml index b9118f90..61e15705 100644 --- a/.buildkite/bump-golang.yml +++ b/.buildkite/bump-golang.yml @@ -63,15 +63,25 @@ conditions: image: golang tag: '{{ source "latestGoVersion" }}' sourceid: latestGoVersion - is: +## As long as there is a bug see https://github.com/updatecli/updatecli/issues/1849 +## Let's use the shell kind rather than the file kind. +## When fixed then uncomment the code and remove is-already-updated +# is: +# name: Is version '{{ source "latestGoVersion" }}' not updated in 'go/Makefile.common'? +# disablesourceinput: true +# kind: file +# spec: +# file: go/Makefile.common +# line: 5 +# content: VERSION := {{ source `latestGoVersion` }} +# failwhen: true + is-already-updated: name: Is version '{{ source "latestGoVersion" }}' not updated in 'go/Makefile.common'? disablesourceinput: true - kind: file + kind: shell spec: - file: go/Makefile.common - line: 5 - content: VERSION := {{ source `latestGoVersion` }} - failwhen: true + command: grep 'VERSION := {{ source `latestGoVersion` }}' go/Makefile.common && exit 1 || exit 0 + failwhen: false targets: update-go-version: diff --git a/.github/workflows/bump-golang-previous.yml b/.github/workflows/bump-golang-previous.yml index da871191..477bfd3a 100644 --- a/.github/workflows/bump-golang-previous.yml +++ b/.github/workflows/bump-golang-previous.yml @@ -9,9 +9,6 @@ on: permissions: contents: read -env: - JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - jobs: bump: runs-on: ubuntu-latest @@ -26,5 +23,3 @@ jobs: vaultUrl: ${{ secrets.VAULT_ADDR }} vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - notifySlackChannel: "#ingest-notifications" - messageIfFailure: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @agent-team please look what's going on <${{ env.JOB_URL }}|here>" diff --git a/.github/workflows/bump-golang.yml b/.github/workflows/bump-golang.yml index 87ac4639..3cb3bcfe 100644 --- a/.github/workflows/bump-golang.yml +++ b/.github/workflows/bump-golang.yml @@ -9,9 +9,6 @@ on: permissions: contents: read -env: - JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - jobs: bump: runs-on: ubuntu-latest @@ -25,5 +22,3 @@ jobs: vaultUrl: ${{ secrets.VAULT_ADDR }} vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - notifySlackChannel: "#ingest-notifications" - messageIfFailure: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @agent-team please look what's going on <${{ env.JOB_URL }}|here>" diff --git a/.github/workflows/bump-golang/action.yml b/.github/workflows/bump-golang/action.yml index 88448764..70cf73c0 100644 --- a/.github/workflows/bump-golang/action.yml +++ b/.github/workflows/bump-golang/action.yml @@ -7,6 +7,14 @@ inputs: go-minor: description: 'What Go minor version ([0-9]+.[0.9]+)' required: true + messageIfFailure: + description: 'Vault secret ID' + required: false + default: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @agent-team please look what's going on <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>" + notifySlackChannel: + description: 'Vault secret ID' + required: false + default: "#ingest-notifications" vaultUrl: description: 'Vault URL' required: true @@ -30,6 +38,8 @@ runs: vaultRoleId: ${{ inputs.vaultRoleId }} vaultSecretId: ${{ inputs.vaultSecretId }} pipeline: ./.buildkite/bump-golang.yml + notifySlackChannel: ${{ inputs.notifySlackChannel }} + messageIfFailure: ${{ inputs.messageIfFailure }} env: BRANCH: ${{ inputs.branch }} GO_MINOR: ${{ inputs.go-minor }}