Skip to content

chore(ci): add base script for building and testing #43

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

Merged
merged 7 commits into from
Jul 17, 2025
Merged
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
22 changes: 22 additions & 0 deletions .github/workflows/buildTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Carbon React Router starter template CI

on: [push]

jobs:
run-defined-frontend-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v4
- name: Read .nvmrc
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
id: nvm
- name: Use Node.js ${{ steps.nvm.outputs.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
- run: npm ci
- run: npm run build
- run: npm run test
Comment on lines +7 to +22

Check warning

Code 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 Autofix

AI 6 days ago

To fix the issue, we will add a permissions block at the root of the workflow file. This block will specify the least privileges required for the workflow to function correctly. Based on the provided workflow, it primarily involves checking out the repository, setting up Node.js, installing dependencies, building the project, and running tests. These tasks only require contents: read permissions, as no write operations are performed.

The permissions block will be added after the name field and before the on field in the workflow file.


Suggested changeset 1
.github/workflows/buildTest.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/buildTest.yml b/.github/workflows/buildTest.yml
--- a/.github/workflows/buildTest.yml
+++ b/.github/workflows/buildTest.yml
@@ -1,2 +1,4 @@
 name: Carbon React Router starter template CI
+permissions:
+  contents: read
 
EOF
@@ -1,2 +1,4 @@
name: Carbon React Router starter template CI
permissions:
contents: read

Copilot is powered by AI and may make mistakes. Always verify output.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.19.2
24.4.1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ It is intended to be helping, not dictating. If you don't know exactly what to u
## Get started

1. Clone this template
1. Install the dependencies. _Requires Node 20_
1. Install the dependencies. _Requires Node 24_
```
nvm i # Optional, but desirable to make sure you have the supported version
npm i
Expand Down
Loading
Loading