Skip to content

Commit cd3a692

Browse files
committed
improve github actions security
1 parent 0bc21de commit cd3a692

10 files changed

Lines changed: 36 additions & 32 deletions

.github/workflows/cleanup-branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Delete merged branch
16-
uses: actions/github-script@v7
16+
uses: actions/github-script@v9
1717
with:
1818
script: |
1919
const branch = context.payload.pull_request.head.ref;

.github/workflows/copilot-setup-steps.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
paths:
1212
- .github/workflows/copilot-setup-steps.yml
1313

14+
permissions: {}
15+
1416
jobs:
1517
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
1618
copilot-setup-steps:
@@ -21,7 +23,7 @@ jobs:
2123

2224
steps:
2325
- name: Checkout code
24-
uses: actions/checkout@v4
26+
uses: actions/checkout@v6
2527

2628
- name: Setup Tools
2729
uses: kubb-labs/config/.github/setup@main

.github/workflows/docker-agent.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ env:
2020
REGISTRY_DOCKER: docker.io
2121
IMAGE_NAME: kubb-agent
2222

23+
permissions: {}
24+
2325
jobs:
2426
build-and-push:
2527
runs-on: ubuntu-latest
@@ -41,30 +43,30 @@ jobs:
4143
node-version: '22'
4244

4345
- name: Set up Docker Buildx
44-
uses: docker/setup-buildx-action@v3
46+
uses: docker/setup-buildx-action@v4
4547

4648
- name: Build
4749
run: pnpm run build
4850

4951
- name: Log in to GitHub Container Registry
5052
if: github.event_name != 'pull_request'
51-
uses: docker/login-action@v3
53+
uses: docker/login-action@v4
5254
with:
5355
registry: ${{ env.REGISTRY_GHCR }}
5456
username: ${{ github.actor }}
5557
password: ${{ secrets.GITHUB_TOKEN }}
5658

5759
- name: Log in to Docker Hub
5860
if: github.event_name != 'pull_request'
59-
uses: docker/login-action@v3
61+
uses: docker/login-action@v4
6062
with:
6163
registry: ${{ env.REGISTRY_DOCKER }}
6264
username: ${{ secrets.DOCKERHUB_USERNAME }}
6365
password: ${{ secrets.DOCKERHUB_TOKEN }}
6466

6567
- name: Extract metadata
6668
id: meta
67-
uses: docker/metadata-action@v5
69+
uses: docker/metadata-action@v6
6870
with:
6971
images: |
7072
${{ env.REGISTRY_GHCR }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
@@ -81,7 +83,7 @@ jobs:
8183
8284
- name: Build and push Docker image
8385
id: push
84-
uses: docker/build-push-action@v6
86+
uses: docker/build-push-action@v7
8587
with:
8688
context: ./packages/agent
8789
file: ./packages/agent/Dockerfile
@@ -96,7 +98,7 @@ jobs:
9698
9799
- name: Generate artifact attestation
98100
if: github.event_name != 'pull_request'
99-
uses: actions/attest-build-provenance@v3
101+
uses: actions/attest-build-provenance@v4
100102
continue-on-error: true
101103
with:
102104
subject-name: ${{ env.REGISTRY_GHCR }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}

.github/workflows/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Labeler
22
on:
33
- pull_request_target
44

5+
permissions: {}
6+
57
jobs:
68
labeler:
79
permissions:

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181

8282
- name: Upload coverage reports to Codecov
8383
if: ${{ !cancelled() }}
84-
uses: codecov/codecov-action@v3
84+
uses: codecov/codecov-action@v6
8585
env:
8686
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8787

@@ -240,7 +240,7 @@ jobs:
240240
241241
- name: Create Pull Request with generated files
242242
if: github.event.pull_request.head.repo.full_name == github.repository
243-
uses: peter-evans/create-pull-request@v7
243+
uses: peter-evans/create-pull-request@v8
244244
with:
245245
base: ${{ github.head_ref || github.ref_name }}
246246
branch: chore/update-generated-examples-${{ github.event.number }}

.github/workflows/release.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ permissions:
1515
actions: write
1616
contents: write
1717
id-token: write
18-
models: read
1918
packages: write
2019
pull-requests: write
2120
issues: write
@@ -51,7 +50,7 @@ jobs:
5150
run: pnpm run test
5251

5352
- name: Upload coverage reports to Codecov
54-
uses: codecov/codecov-action@v3
53+
uses: codecov/codecov-action@v6
5554
env:
5655
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5756

@@ -63,23 +62,22 @@ jobs:
6362
publish: pnpm release
6463
commit: "ci(changesets): version packages"
6564
setupGitUser: false
65+
setupNpmrc: false
6666
env:
67-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
68-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6967
NPM_CONFIG_PROVENANCE: true
7068
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7169

7270
- name: Publish ${{ inputs.tag || 'canary' }}
7371
id: canary
7472
if: steps.changesets.outputs.published != 'true'
75-
run: |
76-
git checkout main
77-
pnpm version:canary
78-
pnpm release:canary --tag ${{ inputs.tag || 'canary' }}
7973
env:
80-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8174
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8275
NPM_CONFIG_PROVENANCE: true
76+
RELEASE_TAG: ${{ inputs.tag || 'canary' }}
77+
run: |
78+
git checkout main
79+
pnpm version:canary
80+
pnpm release:canary --tag "$RELEASE_TAG"
8381
8482
get-version:
8583
name: Get Published Version
@@ -91,7 +89,7 @@ jobs:
9189
steps:
9290
- name: Get version
9391
id: version
94-
uses: actions/github-script@v7
92+
uses: actions/github-script@v9
9593
env:
9694
PUBLISHED_PACKAGES: ${{ needs.release.outputs.published_packages }}
9795
with:
@@ -118,7 +116,7 @@ jobs:
118116
runs-on: ubuntu-latest
119117
steps:
120118
- name: Send a discord notification
121-
uses: actions/github-script@v7
119+
uses: actions/github-script@v9
122120
env:
123121
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
124122
PUBLISHED_PACKAGES: ${{ needs.release.outputs.published_packages }}

.github/workflows/update-agents-skills.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717
build-agents-md:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2121
- name: Generate skills block
2222
id: build
23-
uses: dave1010/skills-to-agents@v1
23+
uses: dave1010/skills-to-agents@v2
2424
with:
2525
repo-root: .
2626
skills-dir: .skills
2727
agents-path: AGENTS.md
28-
- uses: peter-evans/create-pull-request@v7
28+
- uses: peter-evans/create-pull-request@v8
2929
if: steps.build.outputs.changed == 'true'
3030
with:
3131
base: ${{ github.head_ref || github.ref_name }}

.npmrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
registry=https://registry.npmjs.org/
2-
package-manager-strict=false

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,8 @@
7272
},
7373
"engines": {
7474
"node": ">=22",
75-
"pnpm": ">=10.0.0"
76-
},
77-
"packageManager": "pnpm@10.33.3",
78-
"pnpm": {
79-
"onlyBuiltDependencies": [
80-
"esbuild"
81-
]
75+
"pnpm": ">=11.0.0"
8276
},
77+
"packageManager": "pnpm@11.0.5",
8378
"namespace": "@kubb"
8479
}

pnpm-workspace.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ packages:
44
- examples/*
55
- tests/**
66

7+
allowBuilds:
8+
esbuild: true
9+
10+
pmOnFail: warn
11+
minimumReleaseAge: 0
12+
713
catalog:
814
'@kubb/adapter-oas': 5.0.0-beta.4
915
'@kubb/agent': 5.0.0-beta.4

0 commit comments

Comments
 (0)