@codfish/actions 2.0.1 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -64
- package/bin/generate-docs.js +10 -10
- package/comment/README.md +9 -9
- package/comment/action.yml +3 -3
- package/npm-publish-pr/README.md +319 -40
- package/npm-publish-pr/action.yml +271 -87
- package/package.json +19 -14
- package/setup-node-and-install/README.md +77 -34
- package/setup-node-and-install/action.yml +36 -3
- package/.github/codeql-config.yml +0 -21
- package/.github/dependabot.yml +0 -35
- package/.github/workflows/claude-code-review.yml +0 -43
- package/.github/workflows/claude.yml +0 -38
- package/.github/workflows/release.yml +0 -48
- package/.github/workflows/security.yml +0 -103
- package/.github/workflows/update-docs.yml +0 -38
- package/.github/workflows/validate.yml +0 -210
- package/.husky/pre-commit +0 -1
- package/.nvmrc +0 -1
- package/AGENT.md +0 -149
- package/CLAUDE.md +0 -3
- package/CONTRIBUTING.md +0 -316
- package/SECURITY.md +0 -208
- package/eslint.config.js +0 -8
- package/tests/fixtures/.node-version +0 -1
- package/tests/fixtures/.nvmrc +0 -1
- package/tests/fixtures/lockfiles/package-lock.json +0 -12
- package/tests/fixtures/lockfiles/pnpm-lock.yaml +0 -9
- package/tests/fixtures/lockfiles/yarn.lock +0 -7
- package/tests/fixtures/package-json/minimal.json +0 -4
- package/tests/fixtures/package-json/scoped.json +0 -6
- package/tests/fixtures/package-json/valid.json +0 -13
- package/tests/integration/comment/basic.bats +0 -95
- package/tests/integration/npm-pr-version/basic.bats +0 -438
- package/tests/integration/setup-node-and-install/basic.bats +0 -638
- package/tests/scripts/test-helpers.sh +0 -113
- package/tests/scripts/test-runner.sh +0 -115
package/SECURITY.md
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
<!-- prettier-ignore-start -->
|
|
4
|
-
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
5
|
-
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
6
|
-
## Table of Contents
|
|
7
|
-
|
|
8
|
-
- [Supported Versions](#supported-versions)
|
|
9
|
-
- [Reporting a Vulnerability](#reporting-a-vulnerability)
|
|
10
|
-
- [🔒 Private Disclosure](#-private-disclosure)
|
|
11
|
-
- [📋 What to Include](#-what-to-include)
|
|
12
|
-
- [🕐 Response Timeline](#-response-timeline)
|
|
13
|
-
- [Security Best Practices for Users](#security-best-practices-for-users)
|
|
14
|
-
- [🔐 Secrets Management](#-secrets-management)
|
|
15
|
-
- [🏷️ Action Versioning](#-action-versioning)
|
|
16
|
-
- [🔍 Workflow Permissions](#-workflow-permissions)
|
|
17
|
-
- [🛡️ Input Validation](#-input-validation)
|
|
18
|
-
- [Security Features](#security-features)
|
|
19
|
-
- [🔒 Automated Security Scanning](#-automated-security-scanning)
|
|
20
|
-
- [🛡️ Secure Development Practices](#-secure-development-practices)
|
|
21
|
-
- [🔍 Supply Chain Security](#-supply-chain-security)
|
|
22
|
-
- [Known Security Considerations](#known-security-considerations)
|
|
23
|
-
- [GitHub Actions Environment](#github-actions-environment)
|
|
24
|
-
- [npm Publishing (npm-pr-version)](#npm-publishing-npm-pr-version)
|
|
25
|
-
- [Comment Actions](#comment-actions)
|
|
26
|
-
- [Incident Response](#incident-response)
|
|
27
|
-
- [Security Contact](#security-contact)
|
|
28
|
-
- [Acknowledgments](#acknowledgments)
|
|
29
|
-
|
|
30
|
-
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
31
|
-
<!-- prettier-ignore-end -->
|
|
32
|
-
|
|
33
|
-
## Supported Versions
|
|
34
|
-
|
|
35
|
-
This project follows a rolling release model. We provide security updates for:
|
|
36
|
-
|
|
37
|
-
| Version | Supported |
|
|
38
|
-
| ------------------- | ------------------- |
|
|
39
|
-
| main | ✅ Always supported |
|
|
40
|
-
| Latest release tags | ✅ Supported |
|
|
41
|
-
| Older releases | ❌ Not supported |
|
|
42
|
-
|
|
43
|
-
## Reporting a Vulnerability
|
|
44
|
-
|
|
45
|
-
If you discover a security issue, please follow these steps:
|
|
46
|
-
|
|
47
|
-
### 🔒 Private Disclosure
|
|
48
|
-
|
|
49
|
-
**Do NOT create a public issue for security vulnerabilities.**
|
|
50
|
-
|
|
51
|
-
Instead, please report security issues privately using one of these methods:
|
|
52
|
-
|
|
53
|
-
1. **GitHub Security Advisories** (preferred)
|
|
54
|
-
- Go to the [Security tab](https://github.com/codfish/actions/security/advisories)
|
|
55
|
-
- Click "Report a vulnerability"
|
|
56
|
-
- Fill out the form with details
|
|
57
|
-
|
|
58
|
-
2. **Email**
|
|
59
|
-
- Send details to: [chris@codfish.dev](mailto:chris@codfish.dev)
|
|
60
|
-
- Include "SECURITY" in the subject line
|
|
61
|
-
|
|
62
|
-
### 📋 What to Include
|
|
63
|
-
|
|
64
|
-
When reporting a vulnerability, please include:
|
|
65
|
-
|
|
66
|
-
- **Description** of the vulnerability
|
|
67
|
-
- **Steps to reproduce** the issue
|
|
68
|
-
- **Potential impact** of the vulnerability
|
|
69
|
-
- **Suggested fix** (if you have one)
|
|
70
|
-
- **Your contact information** for follow-up
|
|
71
|
-
|
|
72
|
-
### 🕐 Response Timeline
|
|
73
|
-
|
|
74
|
-
We aim to respond to security reports within:
|
|
75
|
-
|
|
76
|
-
- **Initial response**: 24-48 hours
|
|
77
|
-
- **Confirmation/triage**: 2-5 business days
|
|
78
|
-
- **Resolution**: Varies based on complexity
|
|
79
|
-
|
|
80
|
-
## Security Best Practices for Users
|
|
81
|
-
|
|
82
|
-
When using these GitHub Actions in your workflows:
|
|
83
|
-
|
|
84
|
-
### 🔐 Secrets Management
|
|
85
|
-
|
|
86
|
-
- **Never log secrets** in workflows that use these actions
|
|
87
|
-
- Use **GitHub Secrets** for sensitive information
|
|
88
|
-
- **Limit secret scope** to only necessary workflows
|
|
89
|
-
- **Rotate secrets** regularly
|
|
90
|
-
|
|
91
|
-
```yaml
|
|
92
|
-
# ✅ Good - Using secrets properly
|
|
93
|
-
- uses: codfish/actions/npm-pr-version@v2
|
|
94
|
-
with:
|
|
95
|
-
npm-token: ${{ secrets.NPM_TOKEN }}
|
|
96
|
-
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
97
|
-
|
|
98
|
-
# ❌ Bad - Exposing secrets
|
|
99
|
-
- name: Debug
|
|
100
|
-
run: echo "Token: ${{ secrets.NPM_TOKEN }}"
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### 🏷️ Action Versioning
|
|
104
|
-
|
|
105
|
-
- **Pin to specific versions or commit hashes** for production workflows
|
|
106
|
-
- **Avoid using `@main`** in production (use for testing only)
|
|
107
|
-
|
|
108
|
-
```yaml
|
|
109
|
-
# ✅ Good - Pinned version
|
|
110
|
-
- uses: codfish/actions/setup-node-and-install@v2.2.3
|
|
111
|
-
|
|
112
|
-
# ⚠️ Caution - Latest main (testing only)
|
|
113
|
-
- uses: codfish/actions/setup-node-and-install@main
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### 🔍 Workflow Permissions
|
|
117
|
-
|
|
118
|
-
- **Use minimal permissions** required
|
|
119
|
-
- **Specify explicit permissions** when possible
|
|
120
|
-
- **Avoid using `write-all`** permissions
|
|
121
|
-
|
|
122
|
-
```yaml
|
|
123
|
-
# ✅ Good - Minimal permissions
|
|
124
|
-
permissions:
|
|
125
|
-
contents: read
|
|
126
|
-
issues: write
|
|
127
|
-
pull-requests: write
|
|
128
|
-
|
|
129
|
-
# ❌ Bad - Excessive permissions
|
|
130
|
-
permissions: write-all
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### 🛡️ Input Validation
|
|
134
|
-
|
|
135
|
-
- **Validate user inputs** before using them in actions
|
|
136
|
-
- **Sanitize outputs** when displaying them
|
|
137
|
-
- **Be cautious with dynamic expressions**
|
|
138
|
-
|
|
139
|
-
## Security Features
|
|
140
|
-
|
|
141
|
-
This project implements several security measures:
|
|
142
|
-
|
|
143
|
-
### 🔒 Automated Security Scanning
|
|
144
|
-
|
|
145
|
-
- **Dependabot** for dependency updates
|
|
146
|
-
- **CodeQL** for static analysis
|
|
147
|
-
- **Dependency Review** for PR security checks
|
|
148
|
-
- **Secret scanning** with TruffleHog
|
|
149
|
-
- **npm audit** for vulnerability detection
|
|
150
|
-
|
|
151
|
-
### 🛡️ Secure Development Practices
|
|
152
|
-
|
|
153
|
-
- **Input validation** in all actions
|
|
154
|
-
- **Error handling** without information disclosure
|
|
155
|
-
- **No secret logging** in any action
|
|
156
|
-
- **Least privilege** principle in action permissions
|
|
157
|
-
|
|
158
|
-
### 🔍 Supply Chain Security
|
|
159
|
-
|
|
160
|
-
- **Minimal dependencies** to reduce attack surface
|
|
161
|
-
- **Regular dependency updates** via Dependabot
|
|
162
|
-
- **Verified action references** in workflows
|
|
163
|
-
|
|
164
|
-
## Known Security Considerations
|
|
165
|
-
|
|
166
|
-
### GitHub Actions Environment
|
|
167
|
-
|
|
168
|
-
- **Actions run in GitHub's infrastructure** - we cannot control the runner environment
|
|
169
|
-
- **Secrets are available** to all steps in a job that has access
|
|
170
|
-
- **Workflow logs are visible** to users with read access to the repository
|
|
171
|
-
|
|
172
|
-
### npm Publishing (npm-pr-version)
|
|
173
|
-
|
|
174
|
-
- **NPM tokens have broad permissions** - ensure tokens are scoped appropriately
|
|
175
|
-
- **Published packages are public** by default - review package contents
|
|
176
|
-
- **Version immutability** - published versions cannot be unpublished
|
|
177
|
-
|
|
178
|
-
### Comment Actions
|
|
179
|
-
|
|
180
|
-
- **GitHub tokens can comment** on behalf of the workflow user
|
|
181
|
-
- **Comment content is public** - avoid including sensitive information
|
|
182
|
-
- **Rate limiting applies** - excessive commenting may be throttled
|
|
183
|
-
|
|
184
|
-
## Incident Response
|
|
185
|
-
|
|
186
|
-
In case of a confirmed security vulnerability:
|
|
187
|
-
|
|
188
|
-
1. **Assessment** - Evaluate severity and impact
|
|
189
|
-
2. **Mitigation** - Develop and test fixes
|
|
190
|
-
3. **Disclosure** - Coordinate with reporter on disclosure timeline
|
|
191
|
-
4. **Release** - Deploy security fixes
|
|
192
|
-
5. **Communication** - Notify users through appropriate channels
|
|
193
|
-
|
|
194
|
-
## Security Contact
|
|
195
|
-
|
|
196
|
-
- **Primary**: [security@codfish.dev](mailto:security@codfish.dev)
|
|
197
|
-
- **GitHub**: [@codfish](https://github.com/codfish)
|
|
198
|
-
|
|
199
|
-
## Acknowledgments
|
|
200
|
-
|
|
201
|
-
We appreciate security researchers and users who responsibly disclose vulnerabilities. Contributors who report valid
|
|
202
|
-
security issues will be acknowledged (with permission) in:
|
|
203
|
-
|
|
204
|
-
- Security advisories
|
|
205
|
-
- Release notes
|
|
206
|
-
- This security policy
|
|
207
|
-
|
|
208
|
-
Thank you for helping keep this project secure! 🔒
|
package/eslint.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
20.10.0
|
package/tests/fixtures/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
18.20.0
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "test-package",
|
|
3
|
-
"version": "1.2.3",
|
|
4
|
-
"description": "Test package for action testing",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "echo 'Building...'",
|
|
8
|
-
"test": "echo 'Testing...'"
|
|
9
|
-
},
|
|
10
|
-
"keywords": ["test"],
|
|
11
|
-
"author": "test",
|
|
12
|
-
"license": "MIT"
|
|
13
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
load "../../scripts/test-helpers.sh"
|
|
4
|
-
|
|
5
|
-
setup() {
|
|
6
|
-
setup_github_env
|
|
7
|
-
TEST_DIR=$(mktemp -d)
|
|
8
|
-
cd "$TEST_DIR"
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
teardown() {
|
|
12
|
-
cd /
|
|
13
|
-
cleanup_test_env "$TEST_DIR"
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@test "comment: generates correct tag format" {
|
|
17
|
-
# Test tag generation logic from action
|
|
18
|
-
TAG_INPUT="test-tag"
|
|
19
|
-
MESSAGE_INPUT="Hello, World!"
|
|
20
|
-
|
|
21
|
-
bash -c "
|
|
22
|
-
tag=\"<!-- codfish/actions/comment $TAG_INPUT -->\"
|
|
23
|
-
echo \"Generated tag: \$tag\"
|
|
24
|
-
echo \"tag=\$tag\"
|
|
25
|
-
" > output.txt
|
|
26
|
-
|
|
27
|
-
assert_output_contains "tag=<!-- codfish/actions/comment test-tag -->" "$(cat output.txt)"
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@test "comment: handles multi-line messages" {
|
|
31
|
-
# Test multi-line message handling
|
|
32
|
-
MESSAGE_INPUT="Line 1
|
|
33
|
-
Line 2
|
|
34
|
-
Line 3"
|
|
35
|
-
|
|
36
|
-
bash -c '
|
|
37
|
-
body=$(printf "$1")
|
|
38
|
-
echo "Processed message:"
|
|
39
|
-
echo "$body"
|
|
40
|
-
' -- "$MESSAGE_INPUT" > output.txt
|
|
41
|
-
|
|
42
|
-
assert_output_contains "Line 1" "$(cat output.txt)"
|
|
43
|
-
assert_output_contains "Line 2" "$(cat output.txt)"
|
|
44
|
-
assert_output_contains "Line 3" "$(cat output.txt)"
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@test "comment: handles markdown formatting" {
|
|
48
|
-
# Test markdown message
|
|
49
|
-
MESSAGE_INPUT="## Test Header
|
|
50
|
-
|
|
51
|
-
- Item 1
|
|
52
|
-
- Item 2
|
|
53
|
-
|
|
54
|
-
**Bold text** and *italic text*"
|
|
55
|
-
|
|
56
|
-
bash -c '
|
|
57
|
-
body=$(printf "$1")
|
|
58
|
-
echo "Markdown message:"
|
|
59
|
-
echo "$body"
|
|
60
|
-
' -- "$MESSAGE_INPUT" > output.txt
|
|
61
|
-
|
|
62
|
-
assert_output_contains "## Test Header" "$(cat output.txt)"
|
|
63
|
-
assert_output_contains "- Item 1" "$(cat output.txt)"
|
|
64
|
-
assert_output_contains "**Bold text**" "$(cat output.txt)"
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@test "comment: combines message and tag correctly" {
|
|
68
|
-
# Test complete body generation
|
|
69
|
-
TAG_INPUT="build-status"
|
|
70
|
-
MESSAGE_INPUT="✅ Build successful!"
|
|
71
|
-
|
|
72
|
-
bash -c "
|
|
73
|
-
tag=\"<!-- codfish/actions/comment $TAG_INPUT -->\"
|
|
74
|
-
body=\$(printf '$MESSAGE_INPUT')
|
|
75
|
-
echo \"Complete body:\"
|
|
76
|
-
echo \"\$body\"
|
|
77
|
-
echo \"\$tag\"
|
|
78
|
-
" > output.txt
|
|
79
|
-
|
|
80
|
-
assert_output_contains "✅ Build successful!" "$(cat output.txt)"
|
|
81
|
-
assert_output_contains "<!-- codfish/actions/comment build-status -->" "$(cat output.txt)"
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@test "comment: handles empty tag input" {
|
|
85
|
-
# Test with empty tag
|
|
86
|
-
TAG_INPUT=""
|
|
87
|
-
MESSAGE_INPUT="Message without tag"
|
|
88
|
-
|
|
89
|
-
bash -c "
|
|
90
|
-
tag=\"<!-- codfish/actions/comment $TAG_INPUT -->\"
|
|
91
|
-
echo \"Tag with empty input: \$tag\"
|
|
92
|
-
" > output.txt
|
|
93
|
-
|
|
94
|
-
assert_output_contains "<!-- codfish/actions/comment -->" "$(cat output.txt)"
|
|
95
|
-
}
|