Skip to content

Commit 4c7c547

Browse files
authored
Harden CI workflows (#40)
* Harden GitHub Actions workflows - Pin every action ref to a full-length commit SHA with a trailing version comment, so floating tags like @v4 can't be re-pointed at malicious code. - Bump outdated actions/checkout@v1 to @v4.3.1 (where present). - Tag-triggered workflows now check out with fetch-depth: 1 and fetch-tags: true so the tag ref is available downstream. - release-tracker.yml grants contents: write at the job level so the default GITHUB_TOKEN can push commits/tags back to the repo. Signed-off-by: Tamal Saha <tamal@appscode.com> * Use node-version: '22' in setup-node steps Signed-off-by: Tamal Saha <tamal@appscode.com> * Normalize Prepare git user, fetch-depth, drop permission-issues Signed-off-by: Tamal Saha <tamal@appscode.com> * Add 1gtm-app[bot] to kodiak auto_approve_usernames Signed-off-by: Tamal Saha <tamal@appscode.com> * Normalize kodiak auto_approve_usernames Signed-off-by: Tamal Saha <tamal@appscode.com> * Bump softprops/action-gh-release to v2.6.2; add permissions Signed-off-by: Tamal Saha <tamal@appscode.com> --------- Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent ca69da7 commit 4c7c547

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

.github/.kodiak.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ strip_html_comments = true # default: false
1515
always = true # default: false
1616

1717
[approve]
18-
auto_approve_usernames = ["1gtm", "tamalsaha"]
18+
auto_approve_usernames = ["tamalsaha", "1gtm", "1gtm-app[bot]"]

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
runs-on: ubuntu-24.04
1919

2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2222

2323
- name: Use Node.js 10.x
24-
uses: actions/setup-node@v4
24+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2525
with:
26-
node-version: 10.x
26+
node-version: '22'
2727

2828
- name: Build
2929
env:

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ jobs:
1313
build:
1414
name: Build
1515
runs-on: ubuntu-24.04
16+
permissions:
17+
contents: write
1618
steps:
17-
- uses: actions/checkout@v1
19+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
20+
with:
21+
fetch-depth: 0
1822

1923
- name: Use Node.js
20-
uses: actions/setup-node@v4
24+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2125
with:
22-
node-version: 10.x
26+
node-version: '22'
2327

2428
- name: Build
2529
run: |

0 commit comments

Comments
 (0)