Skip to content

Commit 5f85337

Browse files
authored
Fix secrets context error in setup-minikube composite action (kroxylicious#3539)
Composite actions cannot use[1] the secrets context in input default values. GitHub runners now enforce this, causing intermittent failures: Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.GITHUB_TOKEN Remove the invalid default and pass githubToken explicitly from each workflow that calls the action. [1] https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#secrets-context > The secrets context contains the names and values of secrets that are available to a workflow run. The secrets context is not available for composite actions due to security reasons. If you want to pass a secret to a composite action, you need to do it explicitly as an input. For more information about secrets, see Using secrets in GitHub Actions. Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
1 parent 044e0be commit 5f85337

10 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/actions/common/setup-minikube/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ description: "Installs minikube"
2121
inputs:
2222
githubToken:
2323
description: "Github Token to be used"
24-
required: false
25-
default: ${{ secrets.GITHUB_TOKEN }}
24+
required: true
2625

2726
runs:
2827
using: "composite"

.github/actions/common/slack-notification/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ description: "Slack Notification"
2121
inputs:
2222
slackWebhook:
2323
description: "Slack webhook"
24-
required: false
25-
default: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
24+
required: true
2625
slackColor:
2726
description: "Color for the message"
2827
required: false

.github/workflows/docker.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,6 @@ jobs:
102102
if: failure() && env.SLACK_WEBHOOK_SET == 'true'
103103
uses: ./.github/actions/common/slack-notification
104104
with:
105+
slackWebhook: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
105106
slackTitle: 'Failure Alert: ${{ github.repository }}'
106107
slackMessage: 'The docker build workflow failed on branch ${{ github.ref_name }}.'

.github/workflows/documentation-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646
uses: ./.github/actions/common/setup-java
4747
- name: Setup Minikube
4848
uses: ./.github/actions/common/setup-minikube
49+
with:
50+
githubToken: ${{ secrets.GITHUB_TOKEN }}
4951
- name: 'Set up Docker Buildx'
5052
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
5153
- name: 'Cache Maven packages'
@@ -72,5 +74,6 @@ jobs:
7274
if: failure() && env.SLACK_WEBHOOK_SET == 'true'
7375
uses: ./.github/actions/common/slack-notification
7476
with:
77+
slackWebhook: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
7578
slackTitle: 'Failure Alert: ${{ github.repository }}'
7679
slackMessage: 'The documentation tests workflow failed on branch ${{ github.ref_name }}.'

.github/workflows/lint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ jobs:
6161
if: failure() && env.SLACK_WEBHOOK_SET == 'true'
6262
uses: ./.github/actions/common/slack-notification
6363
with:
64+
slackWebhook: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
6465
slackTitle: 'Failure Alert: ${{ github.repository }}'
6566
slackMessage: 'The lint workflow failed on branch ${{ github.ref_name }}.'

.github/workflows/maven.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ jobs:
6060
javaDistro: ${{ matrix.java.distro }}
6161
- name: Setup Minikube
6262
uses: ./.github/actions/common/setup-minikube
63+
with:
64+
githubToken: ${{ secrets.GITHUB_TOKEN }}
6365
- name: 'Test for unpublished reference release (japicmp)'
6466
run: |
6567
REFERENCE_RELEASE=$(mvn --quiet -pl kroxylicious-api help:evaluate -Dexpression=ApiCompatability.ReferenceVersion -DforceStdout)
@@ -98,5 +100,6 @@ jobs:
98100
if: failure() && env.SLACK_WEBHOOK_SET == 'true'
99101
uses: ./.github/actions/common/slack-notification
100102
with:
103+
slackWebhook: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
101104
slackTitle: 'Failure Alert: ${{ github.repository }}'
102105
slackMessage: 'The maven workflow failed on branch ${{ github.ref_name }}.'

.github/workflows/operator-maven.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
uses: ./.github/actions/common/setup-java
5252
- name: Setup Minikube
5353
uses: ./.github/actions/common/setup-minikube
54+
with:
55+
githubToken: ${{ secrets.GITHUB_TOKEN }}
5456
- name: 'Set up Docker Buildx'
5557
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
5658
- name: 'Cache Maven packages'
@@ -98,5 +100,6 @@ jobs:
98100
if: failure() && env.SLACK_WEBHOOK_SET == 'true'
99101
uses: ./.github/actions/common/slack-notification
100102
with:
103+
slackWebhook: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
101104
slackTitle: 'Failure Alert: ${{ github.repository }}'
102105
slackMessage: 'The operator maven workflow failed on branch ${{ github.ref_name }}.'

.github/workflows/publish-snapshot-docs-to-website.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ jobs:
118118
if: failure() && env.SLACK_WEBHOOK_SET == 'true'
119119
uses: ./kroxylicious/.github/actions/common/slack-notification
120120
with:
121+
slackWebhook: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
121122
slackTitle: 'Failure Alert: ${{ github.repository }}'
122123
slackMessage: 'The snapshot documentation build workflow failed.'
123124

@@ -141,5 +142,6 @@ jobs:
141142
if: failure() && env.SLACK_WEBHOOK_SET == 'true'
142143
uses: ./kroxylicious/.github/actions/common/slack-notification
143144
with:
145+
slackWebhook: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
144146
slackTitle: 'Failure Alert: ${{ github.repository }}'
145147
slackMessage: 'The snapshot documentation deployment workflow failed.'

.github/workflows/run-system-tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ jobs:
7474
uses: ./.github/actions/common/setup-java
7575
- name: Setup Minikube
7676
uses: ./.github/actions/common/setup-minikube
77+
with:
78+
githubToken: ${{ secrets.GITHUB_TOKEN }}
7779
- name: 'Set up Docker Buildx'
7880
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
7981
- name: 'Cache Maven packages'

.github/workflows/system-tests-merge.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,6 @@ jobs:
104104
if: failure() && env.SLACK_WEBHOOK_SET == 'true'
105105
uses: ./.github/actions/common/slack-notification
106106
with:
107+
slackWebhook: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
107108
slackTitle: 'Failure Alert: ${{ github.repository }}'
108109
slackMessage: 'The system tests workflow failed on branch ${{ github.ref_name }}.'

0 commit comments

Comments
 (0)