Skip to content

Commit 488a2be

Browse files
committed
docs: recommend pinning Action version to a commit SHA for security
1 parent 14a8c81 commit 488a2be

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Your first report will be live within 5 minutes.
6161

6262
See [Manual Setup](docs/manual-setup.md) if you prefer to configure everything yourself.
6363

64+
> **Security tip:** The setup command uses `@main` in the generated workflow files. For production use, pin the action to a commit SHA and the CLI to a specific version. See [Pinning Versions](docs/customization.md#pinning-versions).
65+
6466
## Cost
6567

6668
**The entire stack runs at $0/month on a public repository.**

docs/customization.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,31 @@ To change the automatic schedule, edit the `cron:` line. GitHub Actions cron use
129129

130130
The daily fetch should run every day. The weekly report should run once a week (typically Monday), after the daily fetch completes.
131131

132-
## Pinning the CLI Version
132+
## Pinning Versions
133133

134-
By default, workflows use the latest version of the npm package. To pin a specific version for reproducibility, add the `version` input:
134+
### Action Version
135+
136+
By default, the setup command and manual-setup examples reference the action with `@main`. For better security and reproducibility, pin the action to a specific commit SHA:
137+
138+
```yaml
139+
# Before (tracks the main branch, picks up any future change automatically):
140+
- uses: deariary/github-weekly-reporter@main
141+
142+
# After (pinned to a specific commit):
143+
- uses: deariary/github-weekly-reporter@<full-commit-sha> # v0.8.5
144+
```
145+
146+
To find the SHA for a release, visit the [releases page](https://github.com/deariary/github-weekly-reporter/releases) and copy the full commit hash of the tagged commit. Adding a trailing comment with the version tag makes it easy to see which version you are on.
147+
148+
Dependabot and Renovate can automate SHA updates when new versions are released.
149+
150+
### CLI Version
151+
152+
By default, workflows use the latest version of the npm package (`npx github-weekly-reporter@latest`). To pin a specific version, add the `version` input:
135153

136154
```yaml
137155
with:
138-
version: '0.3.0'
156+
version: '0.8.5'
139157
```
140158

141159
## Theme

docs/manual-setup.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
# repositories. The default GITHUB_TOKEN only has access to the
5252
# current repository.
5353
# Add your PAT as a repository secret named GH_PAT (see Step 3).
54+
# Tip: pin to a commit SHA instead of @main for better security.
55+
# See "Pinning Versions" in docs/customization.md.
5456
- uses: deariary/github-weekly-reporter@main
5557
with:
5658
github-token: ${{ secrets.GH_PAT }}
@@ -86,6 +88,8 @@ jobs:
8688
steps:
8789
- uses: actions/checkout@v4
8890
91+
# Tip: pin to a commit SHA instead of @main for better security.
92+
# See "Pinning Versions" in docs/customization.md.
8993
- uses: deariary/github-weekly-reporter@main
9094
with:
9195
github-token: ${{ secrets.GH_PAT }}

0 commit comments

Comments
 (0)