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
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"env": { "node": true, "jest": true },
"parser": "@typescript-eslint/parser",
"parserOptions": { "ecmaVersion": 9, "sourceType": "module" },
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/camelcase": "off"
}
}
1 change: 1 addition & 0 deletions .github/comment-body-addition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is still the second line.
2 changes: 2 additions & 0 deletions .github/comment-body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is a multi-line test comment read from a file.
This is the second line.
27 changes: 27 additions & 0 deletions .github/workflows/actions_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release GitHub Actions

on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the release"
required: true
node_version:
description: "Node.js version to use"
required: false
default: "24"

permissions:
contents: read

jobs:
release:
permissions:
actions: read
id-token: write
contents: write

uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
with:
tag: "${{ github.event.inputs.tag }}"
node_version: ${{ inputs.node_version || '24' }}
33 changes: 33 additions & 0 deletions .github/workflows/audit_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: NPM Audit Fix Run

on:
workflow_dispatch:
inputs:
force:
description: "Use --force flag for npm audit fix?"
required: true
type: boolean
base_branch:
description: "Specify a base branch"
required: false
default: "main"
node_version:
description: "Node.js version to use"
required: false
default: "24"
schedule:
- cron: "0 0 * * 1"

jobs:
audit-fix:
uses: step-security/reusable-workflows/.github/workflows/audit_fix.yml@v1
with:
force: ${{ inputs.force || false }}
base_branch: ${{ inputs.base_branch || 'main' }}
node_version: ${{ inputs.node_version || '24' }}

permissions:
contents: write
pull-requests: write
packages: read
issues: write
42 changes: 42 additions & 0 deletions .github/workflows/auto_cherry_pick.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Auto Cherry-Pick from Upstream

on:
workflow_run:
workflows: [ "Release GitHub Actions" ]
types:
- completed

workflow_dispatch:
inputs:
base_branch:
description: "Base branch to create the PR against"
required: true
default: "main"
mode:
description: "Run mode: cherry-pick or verify"
required: false
default: "cherry-pick"
node_version:
description: "Node.js version to use"
required: false
default: "24"

pull_request:
types: [ opened, synchronize, labeled ]

permissions:
contents: write
pull-requests: write
packages: read
issues: write

jobs:
cherry-pick:
if: (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch' || contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'review-required')
uses: step-security/reusable-workflows/.github/workflows/auto_cherry_pick.yaml@v1
with:
original-owner: "peter-evans"
repo-name: "commit-comment"
base_branch: ${{ inputs.base_branch || 'main' }}
mode: ${{ github.event_name == 'pull_request' && 'verify' || inputs.mode || 'cherry-pick' }}
node_version: ${{ inputs.node_version || '24' }}
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI
on:
push:
branches: [main]
paths-ignore:
- 'README.md'
- 'docs/**'
pull_request:
branches: [main]
paths-ignore:
- 'README.md'
- 'docs/**'

permissions:
pull-requests: write
contents: write

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

contents write is required to pass this workflow as it comments on commit.
if dont want contents: write, need to remove test: step


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: npm
- run: npm ci
- run: npm run build
- run: npm run format-check
- run: npm run lint
- run: npm run test

test:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- name: Test create commit comment
uses: ./
id: cc
with:
body: |
This is a multi-line test comment
- With GitHub **Markdown** :sparkles:
- Created by [commit-comment][1]

[1]: https://github.com/step-security/commit-comment
reactions: '+1'

- name: Test update commit comment
uses: ./
with:
comment-id: ${{ steps.cc.outputs.comment-id }}
body: |
**Edit:** Some additional info
reactions: eyes
reactions-edit-mode: replace

- name: Test add reactions
uses: ./
with:
comment-id: ${{ steps.cc.outputs.comment-id }}
reactions: |
heart
hooray
laugh

- name: Test create commit comment from file
uses: ./
id: cc2
with:
body-path: .github/comment-body.md
reactions: |
+1

- name: Test update commit comment from file
uses: ./
with:
comment-id: ${{ steps.cc2.outputs.comment-id }}
body-path: .github/comment-body-addition.md
append-separator: space
reactions: eyes, rocket
reactions-edit-mode: replace
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib/
node_modules/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
min-release-age=3
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2019 Peter Evans
Copyright (c) 2026 StepSecurity

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading
Loading