Repository navigation
feat: onboarding commit-comment action #1
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
Open
Raj-StepSecurity
wants to merge
2
commits into
main
Choose a base branch
from
release
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+54,344
−1
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| dist/ | ||
| lib/ | ||
| node_modules/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| This is still the second line. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| lib/ | ||
| node_modules/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| min-release-age=3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| dist/ | ||
| lib/ | ||
| node_modules/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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