Skip to content

Commit 08f08a8

Browse files
authored
action: honour the right parameters for notifying and fix condition (#374)
1 parent f2b6d5a commit 08f08a8

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

.buildkite/bump-golang.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,25 @@ conditions:
6363
image: golang
6464
tag: '{{ source "latestGoVersion" }}'
6565
sourceid: latestGoVersion
66-
is:
66+
## As long as there is a bug see https://github.com/updatecli/updatecli/issues/1849
67+
## Let's use the shell kind rather than the file kind.
68+
## When fixed then uncomment the code and remove is-already-updated
69+
# is:
70+
# name: Is version '{{ source "latestGoVersion" }}' not updated in 'go/Makefile.common'?
71+
# disablesourceinput: true
72+
# kind: file
73+
# spec:
74+
# file: go/Makefile.common
75+
# line: 5
76+
# content: VERSION := {{ source `latestGoVersion` }}
77+
# failwhen: true
78+
is-already-updated:
6779
name: Is version '{{ source "latestGoVersion" }}' not updated in 'go/Makefile.common'?
6880
disablesourceinput: true
69-
kind: file
81+
kind: shell
7082
spec:
71-
file: go/Makefile.common
72-
line: 5
73-
content: VERSION := {{ source `latestGoVersion` }}
74-
failwhen: true
83+
command: grep 'VERSION := {{ source `latestGoVersion` }}' go/Makefile.common && exit 1 || exit 0
84+
failwhen: false
7585

7686
targets:
7787
update-go-version:

.github/workflows/bump-golang-previous.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
permissions:
1010
contents: read
1111

12-
env:
13-
JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
14-
1512
jobs:
1613
bump:
1714
runs-on: ubuntu-latest
@@ -26,5 +23,3 @@ jobs:
2623
vaultUrl: ${{ secrets.VAULT_ADDR }}
2724
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
2825
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
29-
notifySlackChannel: "#ingest-notifications"
30-
messageIfFailure: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @agent-team please look what's going on <${{ env.JOB_URL }}|here>"

.github/workflows/bump-golang.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
permissions:
1010
contents: read
1111

12-
env:
13-
JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
14-
1512
jobs:
1613
bump:
1714
runs-on: ubuntu-latest
@@ -25,5 +22,3 @@ jobs:
2522
vaultUrl: ${{ secrets.VAULT_ADDR }}
2623
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
2724
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
28-
notifySlackChannel: "#ingest-notifications"
29-
messageIfFailure: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @agent-team please look what's going on <${{ env.JOB_URL }}|here>"

.github/workflows/bump-golang/action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ inputs:
77
go-minor:
88
description: 'What Go minor version ([0-9]+.[0.9]+)'
99
required: true
10+
messageIfFailure:
11+
description: 'Vault secret ID'
12+
required: false
13+
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>"
14+
notifySlackChannel:
15+
description: 'Vault secret ID'
16+
required: false
17+
default: "#ingest-notifications"
1018
vaultUrl:
1119
description: 'Vault URL'
1220
required: true
@@ -30,6 +38,8 @@ runs:
3038
vaultRoleId: ${{ inputs.vaultRoleId }}
3139
vaultSecretId: ${{ inputs.vaultSecretId }}
3240
pipeline: ./.buildkite/bump-golang.yml
41+
notifySlackChannel: ${{ inputs.notifySlackChannel }}
42+
messageIfFailure: ${{ inputs.messageIfFailure }}
3343
env:
3444
BRANCH: ${{ inputs.branch }}
3545
GO_MINOR: ${{ inputs.go-minor }}

0 commit comments

Comments
 (0)