Skip to content
Closed
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
61 changes: 61 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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.

# This workflow checks out code, performs a Codacy security scan
# and integrates the results with the
# GitHub Advanced Security code scanning feature. For more information on
# the Codacy security scan action usage and parameters, see
# https://github.com/codacy/codacy-analysis-cli-action.
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.

name: Codacy Security Scan

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '26 8 * * 0'

permissions:
contents: read

jobs:
codacy-security-scan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v4

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
36 changes: 36 additions & 0 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Check failure on line 14 in .github/workflows/npm-publish-github-packages.yml

View workflow job for this annotation

GitHub Actions / lint

the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
- uses: actions/setup-node@v3

Check failure on line 15 in .github/workflows/npm-publish-github-packages.yml

View workflow job for this annotation

GitHub Actions / lint

the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
with:
node-version: 16
- run: npm ci
- run: npm test
Comment on lines +14 to +19
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update deprecated actions and Node version (pipeline is failing).

  • actions/checkout@v3 and actions/setup-node@v3 are flagged as too old by the runner.
  • Node 16 is EOL; use an active LTS (20.x) or current (22.x).

Apply:

-      - uses: actions/checkout@v3
-      - uses: actions/setup-node@v3
+      - uses: actions/checkout@v4
+      - uses: actions/setup-node@v4
         with:
-          node-version: 16
+          node-version: 20.x
+          cache: npm
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm test
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm test
🧰 Tools
🪛 GitHub Check: lint

[failure] 15-15:
the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue


[failure] 14-14:
the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

🪛 GitHub Actions: lint workflows

[error] 14-14: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]

🤖 Prompt for AI Agents
In .github/workflows/npm-publish-github-packages.yml around lines 14 to 19, the
workflow uses deprecated action versions and an EOL Node version; replace
actions/checkout@v3 with actions/checkout@v4 and actions/setup-node@v3 with
actions/setup-node@v4 (or latest stable tags), update the node-version from 16
to a currently supported LTS like 20 (or 22), and ensure the setup-node step
remains before npm ci and npm test so the correct Node is used during install
and test.


publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3

Check failure on line 28 in .github/workflows/npm-publish-github-packages.yml

View workflow job for this annotation

GitHub Actions / lint

the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
- uses: actions/setup-node@v3

Check failure on line 29 in .github/workflows/npm-publish-github-packages.yml

View workflow job for this annotation

GitHub Actions / lint

the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}