Skip to content

chore: add CI workflow and SECURITY.md - #23

Closed
donny-devops wants to merge 1 commit into
mainfrom
chore/add-ci-and-security
Closed

chore: add CI workflow and SECURITY.md#23
donny-devops wants to merge 1 commit into
mainfrom
chore/add-ci-and-security

Conversation

@donny-devops

Copy link
Copy Markdown
Owner

Adds CI workflow pinned to Node 20 and a SECURITY.md file.

Copilot AI review requested due to automatic review settings July 7, 2026 12:46
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add GitHub Actions CI (Node 20) and SECURITY.md policy

⚙️ Configuration changes 📝 Documentation 🕐 Less than 10 minutes

Grey Divider

AI Description

• Add GitHub Actions CI workflow running build and tests on pushes/PRs to main.
• Pin CI to Node.js 20.x with npm dependency caching.
• Publish SECURITY.md with supported versions and vulnerability reporting guidance.
Diagram

graph TD
  A["Repository"] --> B["SECURITY.md"]
  C["Push/PR to main"] --> D["CI workflow"] --> E["Ubuntu runner"] --> F["Node 20 + npm cache"] --> G["npm ci"] --> H["build"] --> I["test"]
Loading
High-Level Assessment

Current approach is appropriate for a baseline CI + security policy addition. Consider future incremental enhancements only if needed (e.g., add a lint step, a Node version matrix, or concurrency/cancel-in-progress), but they are not required for this PR’s stated scope.

Files changed (2) +33 / -0

Documentation (1) +12 / -0
SECURITY.mdAdd repository security policy and reporting process +12/-0

Add repository security policy and reporting process

• Adds SECURITY.md describing supported versions (main) and instructing reporters to use GitHub security advisories instead of public issues.

SECURITY.md

Other (1) +21 / -0
ci.ymlAdd CI workflow for build/test on Node 20 +21/-0

Add CI workflow for build/test on Node 20

• Introduces a GitHub Actions workflow triggered on pushes and pull requests to main. The job checks out code, sets up Node.js 20.x with npm caching, installs dependencies, runs the build, and executes tests.

.github/workflows/ci.yml

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new SECURITY.md file to establish the repository's security policy, detailing supported versions and instructions for reporting vulnerabilities. The feedback suggests enhancing the reporting section by providing a direct relative link to the GitHub Security Advisory creation page for a better user experience.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread SECURITY.md
Comment on lines +11 to +12
Please report security vulnerabilities through the repository's security advisory.
Do not open public issues for security defects.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-medium medium

To make it easier for security researchers and users to report vulnerabilities, consider providing a direct relative link to the repository's security advisory creation page. This allows users to click directly through to the private reporting form on GitHub without having to manually navigate the repository's tabs.

Suggested change
Please report security vulnerabilities through the repository's security advisory.
Do not open public issues for security defects.
Please report security vulnerabilities through the repository's [Security Advisory](../../security/advisories/new).
Do not open public issues for security defects.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR adds CI infrastructure and security documentation, but requires critical security fixes before merge.

Critical Changes Required:

  1. CI Security: Pin GitHub Actions to commit SHAs to prevent supply chain attacks (CWE-1357)
  2. Resource Protection: Add job timeout to prevent runaway workflows
  3. Security Documentation: Replace vague "main" branch reference with specific version numbers and provide actionable vulnerability reporting instructions

The redundant working-directory configuration should also be removed for cleaner workflow definition.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment thread .github/workflows/ci.yml
Comment on lines +14 to +15
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Security Vulnerability: GitHub Actions should be pinned to full-length commit SHAs instead of tags to prevent supply chain attacks. Mutable tags can be redirected to malicious code.1

Pin actions/checkout and actions/setup-node to their specific commit SHAs.

Suggested change
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0

Footnotes

  1. CWE-1357: Reliance on Insufficiently Trustworthy Component - https://cwe.mitre.org/data/definitions/1357.html

Comment thread .github/workflows/ci.yml
Comment on lines +8 to +9
build:
runs-on: ubuntu-latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Add a timeout to prevent workflows from consuming excessive resources if they hang. Without a timeout, jobs can run up to the maximum limit (6 hours for GitHub-hosted runners).

Suggested change
build:
runs-on: ubuntu-latest
build:
timeout-minutes: 10
runs-on: ubuntu-latest

Comment thread .github/workflows/ci.yml
Comment on lines +8 to +13
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove redundant working-directory configuration. The default working directory is already the repository root (.), making this explicit setting unnecessary.

Suggested change
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
build:
runs-on: ubuntu-latest
steps:

Comment thread SECURITY.md
Comment on lines +5 to +7
| Version | Supported |
| ------- | ------------------ |
| main | :white_check_mark: |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Replace vague "main" branch reference with specific semantic version numbers. Users need to know which released versions receive security support, not which branch is active.

Suggested change
| Version | Supported |
| ------- | ------------------ |
| main | :white_check_mark: |
| Version | Supported |
| ------- | ------------------ |
| 1.x | :white_check_mark: |
| < 1.0 | :x: |

Comment thread SECURITY.md
Comment on lines +11 to +12
Please report security vulnerabilities through the repository's security advisory.
Do not open public issues for security defects.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Provide a specific contact method or link for reporting vulnerabilities. The current instruction lacks actionable information about where to find the security advisory feature.

Suggested change
Please report security vulnerabilities through the repository's security advisory.
Do not open public issues for security defects.
Please report security vulnerabilities through GitHub's Security Advisories at:
Do not open public issues for security defects.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. npm ci missing lockfile 🐞 Bug ≡ Correctness
Description
The workflow runs npm ci, which requires a committed npm lockfile; without
package-lock.json/npm-shrinkwrap.json, the CI job will fail during dependency installation. This
prevents build/tests from running at all on PRs and pushes.
Code

.github/workflows/ci.yml[R18-20]

+          cache: npm
+      - run: npm ci
+      - run: npm run -s build
Evidence
The workflow explicitly runs npm ci. The repository’s setup instructions use npm install and
there is no lockfile referenced/committed alongside the existing package.json, indicating npm ci
will not be able to proceed.

.github/workflows/ci.yml[14-21]
README.md[17-22]
package.json[1-41]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`.github/workflows/ci.yml` runs `npm ci`, but the repo does not include an npm lockfile. `npm ci` errors when `package-lock.json` / `npm-shrinkwrap.json` is missing.

## Issue Context
The repo’s docs show `npm install` for local setup, and the workflow expects a deterministic install (`npm ci`).

## Fix Focus Areas
- .github/workflows/ci.yml[18-21]

## Suggested fix
Choose one:
1) Preferred (deterministic CI): generate and commit `package-lock.json` (run `npm install` once, commit the lockfile) and keep `npm ci`.
2) If you intentionally don’t want a lockfile: change the workflow install step to `npm install` (and consider removing `cache: npm` since setup-node’s npm caching relies on a lockfile).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Unpinned action references 🐞 Bug ⛨ Security
Description
The workflow uses floating major-version tags for GitHub Actions, so the executed code can change
without a PR in this repo. This weakens CI supply-chain integrity compared to pinning to full commit
SHAs.
Code

.github/workflows/ci.yml[R14-16]

+      - uses: actions/checkout@v4
+      - uses: actions/setup-node@v4
+        with:
Evidence
The workflow explicitly uses tag-based action refs (@v4) rather than immutable commit SHAs.

.github/workflows/ci.yml[14-16]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workflow references actions by major tags (e.g. `actions/checkout@v4`). Tags intentionally move forward, meaning your CI behavior can change without any repo change.

## Issue Context
Pinning to a commit SHA improves supply-chain integrity and reproducibility.

## Fix Focus Areas
- .github/workflows/ci.yml[14-16]

## Suggested fix
Replace tag refs with full SHAs, e.g.
- `uses: actions/checkout@<full_sha>`
- `uses: actions/setup-node@<full_sha>`
Optionally keep a comment indicating the corresponding version (v4.x.y) for maintainability.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Runner image not pinned 🐞 Bug ☼ Reliability
Description
Using ubuntu-latest makes CI environment changes implicit as GitHub updates the alias, which can
introduce unexpected build/test differences over time. Pinning a specific Ubuntu version improves
reproducibility.
Code

.github/workflows/ci.yml[9]

+    runs-on: ubuntu-latest
Evidence
The job runner is configured as ubuntu-latest, which is an alias that can move to a different
Ubuntu release.

.github/workflows/ci.yml[8-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`runs-on: ubuntu-latest` can change the OS image under your workflow over time.

## Issue Context
Pinning reduces CI drift and makes failures easier to reproduce.

## Fix Focus Areas
- .github/workflows/ci.yml[8-10]

## Suggested fix
Change to a pinned runner label, e.g. `runs-on: ubuntu-24.04` (or `ubuntu-22.04` if you prefer the older LTS).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread .github/workflows/ci.yml
Comment on lines +18 to +20
cache: npm
- run: npm ci
- run: npm run -s build

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Npm ci missing lockfile 🐞 Bug ≡ Correctness

The workflow runs npm ci, which requires a committed npm lockfile; without
package-lock.json/npm-shrinkwrap.json, the CI job will fail during dependency installation. This
prevents build/tests from running at all on PRs and pushes.
Agent Prompt
## Issue description
`.github/workflows/ci.yml` runs `npm ci`, but the repo does not include an npm lockfile. `npm ci` errors when `package-lock.json` / `npm-shrinkwrap.json` is missing.

## Issue Context
The repo’s docs show `npm install` for local setup, and the workflow expects a deterministic install (`npm ci`).

## Fix Focus Areas
- .github/workflows/ci.yml[18-21]

## Suggested fix
Choose one:
1) Preferred (deterministic CI): generate and commit `package-lock.json` (run `npm install` once, commit the lockfile) and keep `npm ci`.
2) If you intentionally don’t want a lockfile: change the workflow install step to `npm install` (and consider removing `cache: npm` since setup-node’s npm caching relies on a lockfile).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread .github/workflows/ci.yml
Comment on lines +14 to +16
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. Unpinned action references 🐞 Bug ⛨ Security

The workflow uses floating major-version tags for GitHub Actions, so the executed code can change
without a PR in this repo. This weakens CI supply-chain integrity compared to pinning to full commit
SHAs.
Agent Prompt
## Issue description
The workflow references actions by major tags (e.g. `actions/checkout@v4`). Tags intentionally move forward, meaning your CI behavior can change without any repo change.

## Issue Context
Pinning to a commit SHA improves supply-chain integrity and reproducibility.

## Fix Focus Areas
- .github/workflows/ci.yml[14-16]

## Suggested fix
Replace tag refs with full SHAs, e.g.
- `uses: actions/checkout@<full_sha>`
- `uses: actions/setup-node@<full_sha>`
Optionally keep a comment indicating the corresponding version (v4.x.y) for maintainability.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread .github/workflows/ci.yml
branches: [main]
jobs:
build:
runs-on: ubuntu-latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

3. Runner image not pinned 🐞 Bug ☼ Reliability

Using ubuntu-latest makes CI environment changes implicit as GitHub updates the alias, which can
introduce unexpected build/test differences over time. Pinning a specific Ubuntu version improves
reproducibility.
Agent Prompt
## Issue description
`runs-on: ubuntu-latest` can change the OS image under your workflow over time.

## Issue Context
Pinning reduces CI drift and makes failures easier to reproduce.

## Fix Focus Areas
- .github/workflows/ci.yml[8-10]

## Suggested fix
Change to a pinned runner label, e.g. `runs-on: ubuntu-24.04` (or `ubuntu-22.04` if you prefer the older LTS).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2bbc1a7875

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml
with:
node-version: 20.x
cache: npm
- run: npm ci

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add a lockfile before running npm ci

In the workflow as added, every push/PR job fails at this step because the repository has package.json but no package-lock.json or npm-shrinkwrap.json (confirmed with repo-wide file listing). I also checked npm ci --dry-run, which reports that npm ci can only install with an existing lockfile, so CI cannot reach the build or test steps until either a lockfile is committed or this uses an install command that can generate one.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds baseline repository governance and automation by introducing a Security Policy and a GitHub Actions CI workflow aligned to the project’s Node 20 requirement.

Changes:

  • Added SECURITY.md documenting supported versions and a vulnerability reporting process.
  • Added a GitHub Actions CI workflow that installs dependencies, builds, and runs tests on pushes/PRs to main.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
SECURITY.md Introduces a Security Policy and vulnerability reporting guidance.
.github/workflows/ci.yml Adds a CI job that installs dependencies, builds, and runs the test suite on Node 20.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
with:
node-version: 20.x
cache: npm
- run: npm ci
Comment thread .github/workflows/ci.yml
Comment on lines +1 to +7
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
Comment thread SECURITY.md

## Reporting a Vulnerability

Please report security vulnerabilities through the repository's security advisory.

Copy link
Copy Markdown
Owner Author

Closing as superseded by #24, which bundles the CI workflow and SECURITY.md. Reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants