-
Notifications
You must be signed in to change notification settings - Fork 0
repo: CI workflow cleanup and repository configuration alignment #48
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: master
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 |
|---|---|---|
| @@ -1,19 +1,53 @@ | ||
| version: 2 | ||
|
|
||
| updates: | ||
| - package-ecosystem: "npm" | ||
|
Check warning on line 4 in .github/dependabot.yml
|
||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| time: "05:00" | ||
| timezone: "America/Chicago" | ||
| open-pull-requests-limit: 5 | ||
| groups: | ||
| npm-production: | ||
| dependency-type: "production" | ||
| npm-development: | ||
| dependency-type: "development" | ||
| labels: | ||
| - "dependencies" | ||
| - "security" | ||
| commit-message: | ||
| prefix: "deps" | ||
|
|
||
| - package-ecosystem: "github-actions" | ||
|
Check warning on line 23 in .github/dependabot.yml
|
||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| time: "05:30" | ||
| timezone: "America/Chicago" | ||
| open-pull-requests-limit: 5 | ||
| groups: | ||
| github-actions: | ||
| patterns: | ||
| - "*" | ||
| labels: | ||
| - "dependencies" | ||
| - "security" | ||
| commit-message: | ||
| prefix: "deps" | ||
|
|
||
| - package-ecosystem: "cargo" | ||
|
Check warning on line 41 in .github/dependabot.yml
|
||
| directory: "/circuits/non_mem_gadget" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| time: "06:00" | ||
| timezone: "America/Chicago" | ||
| open-pull-requests-limit: 3 | ||
| labels: | ||
| - "dependencies" | ||
| - "security" | ||
| commit-message: | ||
| prefix: "deps" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,33 @@ | ||
| ## Summary | ||
|
|
||
| - Describe the change | ||
| - Describe the change and why it is needed. | ||
|
|
||
| ## AI Disclosure | ||
| ## Change Type | ||
|
|
||
| - [ ] AI-assisted changes are included in this PR | ||
| - [ ] Runtime or API behavior | ||
| - [ ] Security or repo governance | ||
| - [ ] Workflow or CI configuration | ||
| - [ ] Documentation or claims boundary only | ||
| - [ ] Dependency update | ||
|
|
||
| ## Review Checklist | ||
| ## Security Review | ||
|
|
||
| - [ ] Human review requested | ||
| - [ ] Tests added or updated where appropriate | ||
| - [ ] Security impact is described | ||
| - [ ] No secrets, tokens, cookies, or raw PII were added to code, logs, fixtures, or docs | ||
| - [ ] Security impact and remaining risks are described | ||
| - [ ] New permissions, auth assumptions, or trust-boundary changes are called out | ||
| - [ ] Dependency changes were reviewed for risk | ||
|
|
||
| ## Claims Boundary And Docs | ||
|
|
||
| - [ ] Public-facing claims or evaluator docs were updated if needed | ||
| - [ ] No unsupported claims were introduced | ||
|
|
||
| ## Validation | ||
|
|
||
| - [ ] Human review requested | ||
| - [ ] Tests or validation commands were run where appropriate | ||
| - [ ] Workflow changes were reviewed for least privilege and pinned actions | ||
|
|
||
| ## AI Disclosure | ||
|
|
||
| - [ ] AI-assisted changes are included in this PR |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: TrustSignal Contracts CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "packages/contracts/**" | ||
| - ".github/workflows/contracts-ci.yml" | ||
| push: | ||
| branches: | ||
| - work | ||
| - master | ||
| paths: | ||
| - "packages/contracts/**" | ||
| - ".github/workflows/contracts-ci.yml" | ||
|
|
||
| jobs: | ||
| contracts-build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Compile contracts | ||
| run: npm run build:contracts | ||
|
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.
This job runs Useful? React with 👍 / 👎. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: Security / Dependency Review | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| dependency-review: | ||
| name: Dependency diff review | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Dependency review | ||
| uses: actions/dependency-review-action@v4 # GitHub-maintained action pinned to supported major; Dependabot tracks updates. | ||
| with: | ||
| fail-on-severity: high |
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,26 @@ | |||||||||||||||||||||||||||||
| name: TrustSignal Messaging Guardrails | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||
| pull_request: | |||||||||||||||||||||||||||||
| paths: | |||||||||||||||||||||||||||||
| - "README.md" | |||||||||||||||||||||||||||||
| - "USER_MANUAL.md" | |||||||||||||||||||||||||||||
| - "docs/**" | |||||||||||||||||||||||||||||
| - "apps/web/**" | |||||||||||||||||||||||||||||
| - "package.json" | |||||||||||||||||||||||||||||
| - "scripts/check-public-messaging.sh" | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||
| messaging-check: | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout | |||||||||||||||||||||||||||||
| uses: actions/checkout@v6 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Node.js | |||||||||||||||||||||||||||||
| uses: actions/setup-node@v6 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| node-version: 22 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Run messaging guardrail check | |||||||||||||||||||||||||||||
| run: npm run messaging:check | |||||||||||||||||||||||||||||
|
Comment on lines
+15
to
+26
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 3 days ago To fix this, explicitly limit the Concretely, in permissions:
contents: readNo other changes, imports, or new definitions are required, and existing functionality remains the same while documenting and constraining token permissions.
Suggested changeset
1
.github/workflows/messaging-guardrails.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
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.
The workflow executes Useful? React with 👍 / 👎. |
|||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,78 +1,44 @@ | ||
| # This workflow uses actions that are not certified by GitHub. They are provided | ||
| # by a third-party and are governed by separate terms of service, privacy | ||
| # policy, and support documentation. | ||
| name: Security / OpenSSF Scorecard | ||
|
|
||
| name: Scorecard supply-chain security | ||
| on: | ||
| # For Branch-Protection check. Only the default branch is supported. See | ||
| # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection | ||
| branch_protection_rule: | ||
| # To guarantee Maintained check is occasionally updated. See | ||
| # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained | ||
| schedule: | ||
| - cron: '36 3 * * 1' | ||
| push: | ||
| branches: [ "master" ] | ||
| branches: | ||
| - main | ||
| schedule: | ||
| - cron: "23 4 * * 1" | ||
|
|
||
| # Declare default permissions as read only. | ||
| permissions: read-all | ||
| permissions: {} | ||
|
|
||
| jobs: | ||
| analysis: | ||
| name: Scorecard analysis | ||
| scorecard: | ||
| name: OpenSSF Scorecard analysis | ||
| runs-on: ubuntu-latest | ||
| # `publish_results: true` only works when run from the default branch. conditional can be removed if disabled. | ||
| if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request' | ||
| permissions: | ||
| # Needed to upload the results to code-scanning dashboard. | ||
| security-events: write | ||
| # Needed to publish results and get a badge (see publish_results below). | ||
| actions: read | ||
| contents: read | ||
| id-token: write | ||
| # Uncomment the permissions below if installing in a private repository. | ||
| # contents: read | ||
| # actions: read | ||
|
|
||
| security-events: write | ||
| steps: | ||
| - name: "Checkout code" | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - name: Checkout | ||
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v4.1.7 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: "Run analysis" | ||
| uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 | ||
| - name: Run OpenSSF Scorecard | ||
| uses: ossf/scorecard-action@v2.4.3 | ||
| with: | ||
| results_file: results.sarif | ||
| results_file: scorecard-results.sarif | ||
| results_format: sarif | ||
| # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: | ||
| # - you want to enable the Branch-Protection check on a *public* repository, or | ||
| # - you are installing Scorecard on a *private* repository | ||
| # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. | ||
| # repo_token: ${{ secrets.SCORECARD_TOKEN }} | ||
|
|
||
| # Public repositories: | ||
| # - Publish results to OpenSSF REST API for easy access by consumers | ||
| # - Allows the repository to include the Scorecard badge. | ||
| # - See https://github.com/ossf/scorecard-action#publishing-results. | ||
| # For private repositories: | ||
| # - `publish_results` will always be set to `false`, regardless | ||
| # of the value entered here. | ||
| publish_results: true | ||
|
|
||
| # (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore | ||
| # file_mode: git | ||
|
|
||
| # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF | ||
| # format to the repository Actions tab. | ||
| - name: "Upload artifact" | ||
| uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 | ||
| - name: Upload Scorecard SARIF | ||
| uses: github/codeql-action/upload-sarif@v4 # GitHub-maintained action pinned to supported major; Dependabot tracks updates. | ||
| with: | ||
| name: SARIF file | ||
| path: results.sarif | ||
| retention-days: 5 | ||
| sarif_file: scorecard-results.sarif | ||
|
|
||
| # Upload the results to GitHub's code scanning dashboard (optional). | ||
| # Commenting out will disable upload of results to your repo's Code Scanning dashboard | ||
| - name: "Upload to code-scanning" | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| - name: Upload Scorecard artifact | ||
| uses: actions/upload-artifact@v4 # GitHub-maintained action pinned to supported major; Dependabot tracks updates. | ||
| with: | ||
| sarif_file: results.sarif | ||
| name: scorecard-results | ||
| path: scorecard-results.sarif | ||
| retention-days: 7 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 3 days ago
In general, the fix is to add an explicit
permissions:block that grants only the minimal required scopes forGITHUB_TOKEN. For a build-only workflow that just checks out the repo and installs/builds code,contents: readis sufficient.The best minimal, non-functional-change fix here is to add a root-level
permissions:block under the workflowname:andon:section (or immediately afteron:) to apply to all jobs (currently justcontracts-build). We will setcontents: read, which allows checkout and read access but prevents unintended writes. No additional imports or methods are needed since this is YAML configuration only.Concretely, in
.github/workflows/contracts-ci.yml, insert:at the workflow root, between the
on:block (ending at line 14) and thejobs:key (line 16). This documents the permissions and ensures the workflow does not accidentally inherit broader defaults.