-
Notifications
You must be signed in to change notification settings - Fork 0
(chore): migrate to infisical iac secrets #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,11 +12,11 @@ on: | |||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
| packages: write | ||||||
|
|
||||||
| jobs: | ||||||
| publish: | ||||||
| runs-on: blacksmith-4vcpu-ubuntu-2404 | ||||||
| environment: production | ||||||
| steps: | ||||||
| - uses: actions/checkout@v7 | ||||||
| with: | ||||||
|
|
@@ -26,24 +26,24 @@ jobs: | |||||
| with: | ||||||
| node-version: 24 | ||||||
| cache: pnpm | ||||||
| registry-url: https://npm.pkg.github.com | ||||||
| registry-url: https://registry.npmjs.org | ||||||
| scope: "@bearfire-dev" | ||||||
| - run: pnpm install --frozen-lockfile | ||||||
| - run: pnpm check | ||||||
| - if: github.event_name == 'release' | ||||||
| run: pnpm publish --no-git-checks | ||||||
| run: pnpm publish --no-git-checks --access public | ||||||
| env: | ||||||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||||||
| - name: Verify published package | ||||||
| env: | ||||||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
| NPM_CONFIG_USERCONFIG: /dev/null | ||||||
| PACKAGE_VERSION: ${{ inputs.version || github.event.release.tag_name }} | ||||||
| working-directory: ${{ runner.temp }} | ||||||
| run: | | ||||||
| mkdir package-consumer | ||||||
| cd package-consumer | ||||||
| pnpm init | ||||||
| pnpm add --lockfile-only "@bearfire-dev/env@${PACKAGE_VERSION#v}" | ||||||
| pnpm add --lockfile-only --registry=https://registry.npmjs.org "@bearfire-dev/env@${PACKAGE_VERSION#v}" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- .github/workflows/publish.yml ---'
cat -n .github/workflows/publish.yml | sed -n '1,65p'
printf '%s\n' '--- package.json ---'
cat -n package.json | sed -n '1,45p'
printf '%s\n' '--- package-manager declarations ---'
rg -n --glob 'package.json' --glob 'pnpm-workspace.yaml' --glob '.npmrc' --glob 'packageManager' 'pnpm|lockfile-only|frozen-lockfile|registry' .Repository: bearfire-dev/env Length of output: 3588 🌐 Web query:
💡 Result: The behavior you are observing is the intended and documented function of the --lockfile-only flag [1][2]. When you use the --lockfile-only option with pnpm (including version 10.33.4), pnpm performs dependency resolution and updates your pnpm-lock.yaml and package.json files accordingly, but it intentionally skips downloading packages and writing anything to the node_modules directory [3][1][2]. This flag is designed for scenarios where you want to update your lockfile without modifying the local project environment or triggering file downloads [3][4]. Because no installation occurs in the node_modules folder, this behavior is consistent across both the install and add commands [3][1]. If you find that your node_modules directory is not being updated after running an add command, it is because --lockfile-only prevents that step [1]. To update both the lockfile and your node_modules directory, you should run the command without the --lockfile-only flag [1]. Citations:
Make the anonymous verification step perform an install.
Proposed workflow change- pnpm add --lockfile-only --registry=https://registry.npmjs.org "`@bearfire-dev/env`@${PACKAGE_VERSION#v}"
+ pnpm add --registry=https://registry.npmjs.org "`@bearfire-dev/env`@${PACKAGE_VERSION#v}"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| - name: Upload consumer lockfile | ||||||
| uses: actions/upload-artifact@v6 | ||||||
| with: | ||||||
|
|
||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: bearfire-dev/env
Length of output: 2345
🌐 Web query:
pnpm 10.33.4 publish lifecycle scripts prepublishOnly ignore-scripts documentation💡 Result:
In pnpm, including version 10.33.4, the --ignore-scripts flag correctly prevents the execution of publish-related lifecycle scripts during the publish process [1][2]. When you run pnpm publish --ignore-scripts, pnpm explicitly bypasses the execution of lifecycle scripts such as prepublishOnly, prepublish, publish, and postpublish [1]. The implementation ensures that these scripts are skipped, satisfying the expected behavior for users who need to publish without triggering automated tasks defined in the package.json [2]. Important Context for pnpm 10: While --ignore-scripts behaves as expected for the publish command, it is important to note that pnpm 10 introduced a major security change regarding lifecycle scripts during installation [3][4]. As of pnpm 10, lifecycle scripts for dependencies are blocked by default during install to prevent supply chain attacks [3][5]. If you require specific scripts to run during installation, you must explicitly allow them by adding the package name to the pnpm.onlyBuiltDependencies field in your package.json [3][4]. Summary of Behavior: - pnpm publish --ignore-scripts: Skips lifecycle scripts (prepublishOnly, prepublish, publish, postpublish) [1][2]. - pnpm install --ignore-scripts: Prevents the execution of installation scripts [6]. - Note: The --ignore-scripts flag is distinct from the global change in pnpm 10 that blocks dependency lifecycle scripts by default during installation [3][4].
Citations:
Sensitive Data Exposure (CWE-200): Exposure of Sensitive Information to an Unauthorized Actor
Reachability: Internal · Exploitability: Difficult
Keep
NODE_AUTH_TOKENout of lifecycle scripts.pnpm publishrunsprepublishOnlywithNODE_AUTH_TOKENavailable. The hook runspnpm check, so compromised repository code can access the publish token. Use--ignore-scriptsfor the authenticated publish step.Proposed workflow change
📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.29.0)
[info] 34-34: prefer trusted publishing for authentication (use-trusted-publishing): this command
(use-trusted-publishing)
🤖 Prompt for AI Agents