Skip to content

Commit 4f490c3

Browse files
authored
Merge pull request #161 from SocketDev/fix/zizmor-workflow-security
fix: harden GitHub Actions workflows
2 parents 32aae45 + 2618125 commit 4f490c3

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "daily"
8+
cooldown:
9+
default-days: 7
810
- package-ecosystem: "github-actions"
911
directory: "/"
1012
schedule:
1113
interval: "daily"
14+
cooldown:
15+
default-days: 7

.github/workflows/provenance.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ jobs:
2222
id-token: write
2323

2424
steps:
25-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
with:
27+
persist-credentials: false
2628
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f #v6.1.0
2729
with:
2830
node-version: '22'
2931
registry-url: 'https://registry.npmjs.org'
30-
cache: npm
3132
scope: '@socketregistry'
33+
package-manager-cache: false
3234
- run: npm install -g npm@latest
3335
- run: npm ci
3436
- name: Build package
@@ -41,25 +43,13 @@ jobs:
4143
env:
4244
SOCKET_CLI_DEBUG: ${{ inputs.debug }}
4345
- name: Create GitHub Release
44-
id: create_release
45-
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
with:
49-
tag_name: v${{ steps.package-version.outputs.version }}
50-
release_name: Release v${{ steps.package-version.outputs.version }}
51-
body: |
52-
Release of @socketsecurity/mcp v${{ steps.package-version.outputs.version }}
53-
54-
This release has been published to npm with provenance.
55-
draft: false
56-
prerelease: false
57-
- name: Upload Package to Release
58-
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1
5946
env:
6047
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
with:
62-
upload_url: ${{ steps.create_release.outputs.upload_url }}
63-
asset_path: ./socketsecurity-mcp-${{ steps.package-version.outputs.version }}.tgz
64-
asset_name: socketsecurity-mcp-${{ steps.package-version.outputs.version }}.tgz
65-
asset_content_type: application/gzip
48+
VERSION: ${{ steps.package-version.outputs.version }}
49+
run: |
50+
notes=$(printf '%s\n\n%s' \
51+
"Release of @socketsecurity/mcp v${VERSION}" \
52+
"This release has been published to npm with provenance.")
53+
gh release create "v${VERSION}" "socketsecurity-mcp-${VERSION}.tgz" \
54+
--title "Release v${VERSION}" \
55+
--notes "$notes"

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: tests
33

44
on: [pull_request, push]
55

6+
permissions: {}
7+
68
env:
79
FORCE_COLOR: 1
810

@@ -17,7 +19,9 @@ jobs:
1719
node: ['lts/*']
1820

1921
steps:
20-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
with:
24+
persist-credentials: false
2125
- name: Use Node.js ${{ matrix.node }}
2226
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f #v6.1.0
2327
with:

.github/zizmor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rules:
2+
secrets-outside-env:
3+
disable: true

0 commit comments

Comments
 (0)