Skip to content

Commit ddf0ee9

Browse files
committed
Merge branch 'master' into feat/ignore-annotation-flag
2 parents b2b40da + ba9d194 commit ddf0ee9

18 files changed

Lines changed: 149 additions & 114 deletions

.github/actions/loadtest/action.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,37 +209,46 @@ runs:
209209
- name: Post PR comment
210210
if: inputs.post-comment == 'true' && inputs.pr-number != ''
211211
continue-on-error: true
212-
uses: actions/github-script@v7
212+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
213+
# Untrusted/templated values are passed via env and read with process.env
214+
# inside the script, so they are never interpolated into JS source.
215+
env:
216+
SUMMARY_PATH: ${{ github.workspace }}/test/loadtest/summary.md
217+
COMMENT_HEADER: ${{ inputs.comment-header }}
218+
RUN_STATUS: ${{ steps.run.outputs.status }}
219+
TEST_TYPE: ${{ inputs.test-type }}
220+
PR_NUMBER: ${{ inputs.pr-number }}
221+
RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
213222
with:
214223
github-token: ${{ inputs.github-token }}
215224
script: |
216225
const fs = require('fs');
217-
const summaryPath = '${{ github.workspace }}/test/loadtest/summary.md';
226+
const summaryPath = process.env.SUMMARY_PATH;
218227
let summary = 'No results available';
219228
try {
220229
summary = fs.readFileSync(summaryPath, 'utf8');
221230
} catch (e) {
222231
console.log('Could not read summary file:', e.message);
223232
}
224233
225-
const header = '${{ inputs.comment-header }}';
226-
const status = '${{ steps.run.outputs.status }}';
234+
const header = process.env.COMMENT_HEADER;
235+
const status = process.env.RUN_STATUS;
227236
const statusEmoji = status === 'pass' ? ':white_check_mark:' : ':x:';
228237
229238
const body = [
230-
header ? header : `## ${statusEmoji} Load Test Results (${{ inputs.test-type }})`,
239+
header ? header : `## ${statusEmoji} Load Test Results (${process.env.TEST_TYPE})`,
231240
'',
232241
summary,
233242
'',
234243
'---',
235-
`**Artifacts:** [Download](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`,
244+
`**Artifacts:** [Download](${process.env.RUN_URL})`,
236245
].join('\n');
237246
238247
try {
239248
await github.rest.issues.createComment({
240249
owner: context.repo.owner,
241250
repo: context.repo.repo,
242-
issue_number: ${{ inputs.pr-number }},
251+
issue_number: Number(process.env.PR_NUMBER),
243252
body: body
244253
});
245254
console.log('Comment posted successfully');
@@ -252,7 +261,7 @@ runs:
252261
}
253262
254263
- name: Upload results
255-
uses: actions/upload-artifact@v4
264+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
256265
if: always()
257266
with:
258267
name: loadtest-${{ inputs.test-type }}-results

.github/workflows/init-branch-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout code
26-
uses: actions/checkout@v5.0.0
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2727
with:
2828
fetch-depth: 0
2929
token: ${{ secrets.GITHUB_TOKEN }}
@@ -57,7 +57,7 @@ jobs:
5757
git diff
5858
5959
- name: Create pull request
60-
uses: peter-evans/create-pull-request@v7.0.8
60+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
6161
with:
6262
commit-message: "Bump version to ${{ inputs.TARGET_VERSION }}"
6363
title: "Bump version to ${{ inputs.TARGET_VERSION }} on ${{ inputs.TARGET_BRANCH }} branch"

.github/workflows/loadtest.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Add reaction to comment
22-
uses: actions/github-script@v7
22+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
2323
with:
2424
script: |
2525
await github.rest.reactions.createForIssueComment({
@@ -31,7 +31,7 @@ jobs:
3131
3232
- name: Get PR details
3333
id: pr
34-
uses: actions/github-script@v7
34+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
3535
with:
3636
script: |
3737
const pr = await github.rest.pulls.get({
@@ -46,19 +46,19 @@ jobs:
4646
console.log(`PR #${context.issue.number}: ${pr.data.head.ref} -> ${pr.data.base.ref}`);
4747
4848
- name: Checkout PR branch
49-
uses: actions/checkout@v4
49+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
5050
with:
5151
ref: ${{ steps.pr.outputs.head_sha }}
5252
fetch-depth: 0 # Full history for building from base ref
5353

5454
- name: Set up Go
55-
uses: actions/setup-go@v5
55+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
5656
with:
5757
go-version: '1.26'
5858
cache: false
5959

6060
- name: Set up Docker Buildx
61-
uses: docker/setup-buildx-action@v3
61+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
6262

6363
- name: Install kind
6464
run: |
@@ -89,7 +89,7 @@ jobs:
8989
9090
- name: Add success reaction
9191
if: steps.loadtest.outputs.status == 'pass'
92-
uses: actions/github-script@v7
92+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
9393
with:
9494
script: |
9595
await github.rest.reactions.createForIssueComment({
@@ -101,7 +101,7 @@ jobs:
101101
102102
- name: Add failure reaction
103103
if: steps.loadtest.outputs.status == 'fail'
104-
uses: actions/github-script@v7
104+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
105105
with:
106106
script: |
107107
await github.rest.reactions.createForIssueComment({

.github/workflows/pull_request-helm.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ env:
1414
KIND_VERSION: "0.23.0"
1515
REGISTRY: ghcr.io
1616

17+
# Default to no GITHUB_TOKEN permissions; each job opts into the minimum it needs.
18+
permissions: {}
19+
1720
jobs:
1821

1922
helm-chart-validation:
@@ -26,21 +29,23 @@ jobs:
2629
steps:
2730

2831
- name: Check out code
29-
uses: actions/checkout@v5
32+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
3033
with:
3134
ref: ${{github.event.pull_request.head.sha}}
3235
fetch-depth: 0
3336

3437
# Setting up helm binary
3538
- name: Set up Helm
36-
uses: azure/setup-helm@v4
39+
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4
3740
with:
38-
version: v3.11.3
41+
version: v3.20.2
3942

4043
- name: Helm chart unit tests
41-
uses: d3adb5/helm-unittest-action@v2
44+
uses: d3adb5/helm-unittest-action@850bc76597579183998069830d5fa8c3ef0ea34a # v2
4245
with:
4346
charts: deployments/kubernetes/chart/reloader
47+
helm-version: v3.20.2
48+
github-token: ${{ secrets.GITHUB_TOKEN }}
4449

4550
helm-version-validation:
4651
needs: helm-chart-validation
@@ -55,7 +60,7 @@ jobs:
5560
steps:
5661

5762
- name: Check out code
58-
uses: actions/checkout@v5
63+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
5964
with:
6065
ref: ${{github.event.pull_request.head.sha}}
6166
fetch-depth: 0
@@ -71,13 +76,13 @@ jobs:
7176
echo "CURRENT_CHART_VERSION=$(echo ${current_chart_version})" >> $GITHUB_OUTPUT
7277
7378
- name: Get Updated Chart version from Chart.yaml
74-
uses: mikefarah/yq@master
79+
uses: mikefarah/yq@751d8ad57b84f1794661bc70c0afb92a22ad7b3c # v4.53.2
7580
id: new_chart_version
7681
with:
7782
cmd: yq e '.version' deployments/kubernetes/chart/reloader/Chart.yaml
7883

7984
- name: Check Version
80-
uses: aleoyakas/check-semver-increased-action@v1
85+
uses: aleoyakas/check-semver-increased-action@415c9c60054c2442c03478b6dd96a195deac6695 # v1
8186
id: check-version
8287
with:
8388
current-version: ${{ steps.new_chart_version.outputs.result }}

.github/workflows/pull_request.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@ env:
1919
REGISTRY: ghcr.io
2020
RELOADER_EDITION: oss
2121

22+
# Default to no GITHUB_TOKEN permissions; each job opts into the minimum it needs.
23+
permissions: {}
24+
2225
jobs:
2326
qa:
24-
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.163
27+
permissions:
28+
contents: read
29+
pull-requests: write # reusable workflow posts languagetool review comments
30+
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@3dfb835dba6b596fe32e1d0f5eadbb4a3a139a1c # v0.0.163
2531
with:
2632
MD_CONFIG: .github/md_config.json
2733
DOC_SRC: README.md
@@ -38,30 +44,30 @@ jobs:
3844
name: Build
3945
steps:
4046
- name: Check out code
41-
uses: actions/checkout@v5
47+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
4248
with:
4349
ref: ${{github.event.pull_request.head.sha}}
4450
fetch-depth: 0
4551

4652
# Setting up helm binary
4753
- name: Set up Helm
48-
uses: azure/setup-helm@v5
54+
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5
4955
with:
5056
version: v3.20.2
5157

5258
- name: Helm chart unit tests
53-
uses: d3adb5/helm-unittest-action@v2
59+
uses: d3adb5/helm-unittest-action@850bc76597579183998069830d5fa8c3ef0ea34a # v2
5460
with:
5561
charts: deployments/kubernetes/chart/reloader
5662
helm-version: v3.20.2
5763
github-token: ${{ secrets.GITHUB_TOKEN }}
5864

5965
- name: Set up Go
60-
uses: actions/setup-go@v6
66+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
6167
with:
6268
go-version-file: 'go.mod'
6369
check-latest: true
64-
cache: true
70+
cache: false
6571

6672
- name: Create timestamp
6773
id: prep
@@ -130,10 +136,10 @@ jobs:
130136
echo "GIT_UBI_TAG=$(echo ${ubi_tag})" >> $GITHUB_OUTPUT
131137
132138
- name: Set up QEMU
133-
uses: docker/setup-qemu-action@v3
139+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
134140

135141
- name: Set up Docker Buildx
136-
uses: docker/setup-buildx-action@v3
142+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
137143

138144
- name: Generate image repository path for ghcr registry
139145
run: |
@@ -142,7 +148,7 @@ jobs:
142148
# To identify any broken changes in dockerfiles or dependencies
143149

144150
- name: Build Docker Image
145-
uses: docker/build-push-action@v6
151+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
146152
with:
147153
context: .
148154
file: ${{ env.DOCKER_FILE_PATH }}
@@ -155,7 +161,6 @@ jobs:
155161
EDITION=${{ env.RELOADER_EDITION }}
156162
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
157163
158-
cache-to: type=inline
159164
platforms: linux/amd64,linux/arm,linux/arm64
160165
tags: |
161166
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
@@ -165,7 +170,7 @@ jobs:
165170
org.opencontainers.image.revision=${{ github.sha }}
166171
167172
- name: Build Docker UBI Image
168-
uses: docker/build-push-action@v6
173+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
169174
with:
170175
context: .
171176
file: ${{ env.DOCKER_UBI_FILE_PATH }}
@@ -178,7 +183,6 @@ jobs:
178183
EDITION=${{ env.RELOADER_EDITION }}
179184
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
180185
BUILDER_IMAGE=${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.highest_tag.outputs.tag }}
181-
cache-to: type=inline
182186
platforms: linux/amd64,linux/arm64
183187
tags: |
184188
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}

.github/workflows/push-helm-chart.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ env:
1717
HELM_REGISTRY_URL: "https://stakater.github.io/stakater-charts"
1818
REGISTRY: ghcr.io # container registry
1919

20+
# Default to no GITHUB_TOKEN permissions; each job opts into the minimum it needs.
21+
permissions: {}
22+
2023
jobs:
2124
verify-and-push-helm-chart:
2225

@@ -31,17 +34,17 @@ jobs:
3134

3235
steps:
3336
- name: Check out code
34-
uses: actions/checkout@v5
37+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
3538
with:
3639
token: ${{ secrets.PUBLISH_TOKEN }}
3740
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
3841
submodules: recursive
3942

4043
# Setting up helm binary
4144
- name: Set up Helm
42-
uses: azure/setup-helm@v4
45+
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4
4346
with:
44-
version: v3.11.3
47+
version: v3.20.2
4548

4649
- name: Add Stakater Helm Repo
4750
run: |
@@ -54,13 +57,13 @@ jobs:
5457
echo "CURRENT_CHART_VERSION=$(echo ${current_chart_version})" >> $GITHUB_OUTPUT
5558
5659
- name: Get Updated Chart version from Chart.yaml
57-
uses: mikefarah/yq@master
60+
uses: mikefarah/yq@751d8ad57b84f1794661bc70c0afb92a22ad7b3c # v4.53.2
5861
id: new_chart_version
5962
with:
6063
cmd: yq e '.version' deployments/kubernetes/chart/reloader/Chart.yaml
6164

6265
- name: Check Version
63-
uses: aleoyakas/check-semver-increased-action@v1
66+
uses: aleoyakas/check-semver-increased-action@415c9c60054c2442c03478b6dd96a195deac6695 # v1
6467
id: check-version
6568
with:
6669
current-version: ${{ steps.new_chart_version.outputs.result }}
@@ -73,10 +76,10 @@ jobs:
7376
exit 1
7477
7578
- name: Install Cosign
76-
uses: sigstore/cosign-installer@v4.0.0
79+
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
7780

7881
- name: Login to GHCR Registry
79-
uses: docker/login-action@v3
82+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
8083
with:
8184
registry: ${{ env.REGISTRY }}
8285
username: stakater-user
@@ -92,7 +95,7 @@ jobs:
9295
run: cosign sign --yes ghcr.io/stakater/charts/reloader:${{ steps.new_chart_version.outputs.result }}
9396

9497
- name: Publish Helm chart to gh-pages
95-
uses: stefanprodan/helm-gh-pages@master
98+
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # v1.7.0
9699
with:
97100
branch: master
98101
repository: stakater-charts
@@ -106,14 +109,14 @@ jobs:
106109
commit_email: stakater@gmail.com
107110

108111
- name: Push new chart tag
109-
uses: anothrNick/github-tag-action@1.75.0
112+
uses: anothrNick/github-tag-action@4ed44965e0db8dab2b466a16da04aec3cc312fd8 # 1.75.0
110113
env:
111114
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
112115
WITH_V: false
113116
CUSTOM_TAG: chart-v${{ steps.new_chart_version.outputs.result }}
114117

115118
- name: Notify Slack
116-
uses: 8398a7/action-slack@v3
119+
uses: 8398a7/action-slack@77eaa4f1c608a7d68b38af4e3f739dcd8cba273e # v3
117120
if: always() # Pick up events even if the job fails or is canceled.
118121
with:
119122
status: ${{ job.status }}

0 commit comments

Comments
 (0)