Skip to content

Commit

Permalink
action: honour the right parameters for notifying and fix condition (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Jan 12, 2024
1 parent f2b6d5a commit 08f08a8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
22 changes: 16 additions & 6 deletions .buildkite/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/bump-golang-previous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>"
5 changes: 0 additions & 5 deletions .github/workflows/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>"
10 changes: 10 additions & 0 deletions .github/workflows/bump-golang/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

0 comments on commit 08f08a8

Please sign in to comment.