Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 10 * * *'

Expand All @@ -12,10 +13,15 @@ jobs:
name: npm audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: install dependencies
run: npm ci
- uses: oke-py/npm-audit-action@v2.3.0

- uses: oke-py/npm-audit-action@c2ee44bdb97ee28fe9f41d78779ee0127b687778 # v2.3.0
with:
audit_level: moderate
production_flag: true
Expand Down
54 changes: 40 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,58 @@ permissions:
jobs:
publish:
name: Test, Build and publish
runs-on: linux-x64-static-ip-2core-8gb
runs-on: ubuntu-latest
# Single run per release: npm allows one publish per version. A matrix over
# environments would run publish multiple times and the second job would fail.
# Optional: add `environment: npm` (or another single environment) for approval
# gates — see header comments.
steps:
- name: Checkout and Setup
uses: moneyhub/checkout-and-setup@v1
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
quay-io-username: ${{ secrets.QUAY_IO_USERNAME }}
quay-io-password: ${{ secrets.QUAY_IO_PASSWORD }}
npm-token: ${{ secrets.NPM_TOKEN }}
# Trusted publishing (OIDC) requires Node 22.14.0+ and npm 11.5.1+ per npm docs.
# npm-token is still used for registry auth during install (e.g. private scopes);
# use a read-only granular token where possible — publish uses OIDC when available.
persist-credentials: false
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
registry-url: "https://registry.npmjs.org"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing NODE_AUTH_TOKEN for private package installation

High Severity

The old moneyhub/checkout-and-setup@v1 received npm-token: ${{ secrets.NPM_TOKEN }} with an explicit comment that it was "still used for registry auth during install (e.g. private scopes)." The replacement actions/setup-node with registry-url creates an .npmrc referencing NODE_AUTH_TOKEN, but that environment variable is never set. The private @mft/eslint-config-momentumft devDependency will fail to install even once npm ci is added back.

Fix in Cursor Fix in Web

node-version: "22.22"

- name: Ensure npm supports OIDC trusted publishing
run: npm install -g npm@^11.5.1
- name: Run and Report Unit Tests
uses: moneyhub/run-and-report-tests@v1

- name: Install Dependencies
shell: bash
run: npm ci --ignore-scripts

- name: Audit npm signatures
shell: bash
run: npm audit signatures

- name: Run install scripts
shell: bash
run: npm rebuild && npm run prepare --if-present

- name: Run Tests
shell: bash
run: npm run test-ci
Comment thread
cursor[bot] marked this conversation as resolved.
env:
NODE_CONFIG: ${{ secrets.TEST_CONFIG }}

- name: Tests Report
if: success() || failure()
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4.3.1
with:
test-script: test-ci
report-path: test-reports/report.xml
name: Integration
report_paths: test-reports/report.xml
fail_on_failure: true
detailed_summary: true
check_name: Test Report
require_tests: true
require_passed_tests: false
env:
NODE_CONFIG: ${{ secrets.TEST_CONFIG }}

# Publish auth: npm 11.5.1+ exchanges GitHub's OIDC token (id-token: write) for a
# short-lived publish token when trusted publishing is configured. No NODE_AUTH_TOKEN
# is required for publish. Provenance is automatic for trusted publishing from GitHub
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Moneyhub - Github Actions Security with zizmor 🌈

on:
pull_request:
branches:
- main
push:
branches:
- main
Comment thread
MH-Fergus marked this conversation as resolved.

permissions: {}

jobs:
zizmor:
name: Run zizmor 🌈
runs-on: ubuntu-latest
permissions:
security-events: write
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing contents and actions read permissions for zizmor

Medium Severity

The workflow sets permissions: {} at the top level (stripping all defaults), but the job only grants security-events: write. The recommended zizmor configuration also requires contents: read (needed for actions/checkout on private repos and for upload-sarif) and actions: read (needed for zizmor to audit referenced actions via the GitHub API using GH_TOKEN).

Fix in Cursor Fix in Web

steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Install the latest version of uv
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1

- name: Run zizmor 🌈
shell: bash
run: uvx zizmor .
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment thread
MH-Fergus marked this conversation as resolved.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing SARIF upload step in zizmor workflow

High Severity

The workflow generates SARIF output to results.sarif and requests security-events: write permission, but never uploads the SARIF file to GitHub's code scanning. A github/codeql-action/upload-sarif step is missing after the zizmor run step. Without it, the security scan results are discarded and never appear in the repository's Security tab, making the workflow non-functional for its intended purpose.

Fix in Cursor Fix in Web

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zizmor scan results never uploaded as SARIF

Medium Severity

The job requests security-events: write permission but uvx zizmor . outputs in the default text format, not SARIF. There is no --format=sarif flag and no github/codeql-action/upload-sarif step. Findings won't appear in the GitHub Security tab — only in workflow logs. Either the zizmorcore/zizmor-action (which handles SARIF automatically) or a manual --format=sarif plus upload-sarif step is needed to use the requested permission.

Additional Locations (1)
Fix in Cursor Fix in Web

Loading