Skip to content

Commit 9676668

Browse files
committed
ci: gh CLI automation doc, release script, cargo-deny advisories
- docs/gh-automation.md: gh cheat sheet (issues, PRs, workflow run, release) - scripts/gh-release.sh: trigger Prepare release from CLI (e.g. ./scripts/gh-release.sh 0.5.28) - deny.toml + CI job: cargo-deny check advisories (complements cargo-audit) - release-process.md + README: link gh-automation and gh-release.sh Made-with: Cursor
1 parent ab0ad80 commit 9676668

File tree

6 files changed

+137
-2
lines changed

6 files changed

+137
-2
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ jobs:
5050
- name: Audit dependencies
5151
run: cargo audit
5252

53+
cargo-deny:
54+
name: cargo-deny (advisories)
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v5
58+
- uses: dtolnay/rust-toolchain@1.88.0
59+
- uses: Swatinem/rust-cache@v2
60+
- name: Install cargo-deny
61+
run: cargo install cargo-deny --locked
62+
- name: Check advisories
63+
run: cargo deny check advisories
64+
5365
test:
5466
runs-on: ${{ matrix.os }}
5567
strategy:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ The summary includes:
10021002

10031003
Contributions are welcome! Please open an issue first to discuss what you would like to change. Enhancement backlog and triage: see [docs/ROADMAP.md](docs/ROADMAP.md) and `gh issue list --label "priority: high"`.
10041004

1005-
**PR workflow:** Open a PR → ensure CI is green (version, lint, security, test, mutation, review) → merge when ready. Use a short test plan in the PR description. Small, focused PRs are preferred. Use the PR template (Summary, Test plan, **Closes #N**). **Release process:** [docs/release-process.md](docs/release-process.md) (version bump, RELEASE_NOTES, Prepare release workflow).
1005+
**PR workflow:** Open a PR → ensure CI is green (version, lint, security, test, mutation, review) → merge when ready. Use a short test plan in the PR description. Small, focused PRs are preferred. Use the PR template (Summary, Test plan, **Closes #N**). **Release process:** [docs/release-process.md](docs/release-process.md) (version bump, RELEASE_NOTES, Prepare release workflow). **gh CLI:** [docs/gh-automation.md](docs/gh-automation.md) (issues, PRs, workflow run, release from terminal).
10061006

10071007
### Local Development Checks
10081008

deny.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# cargo-deny: https://embarkstudios.github.io/cargo-deny/
2+
# CI runs: cargo deny check advisories (licenses optional; expand allow list to enable).
3+
4+
[advisories]
5+
version = 2
6+
unmaintained = "workspace"
7+
yanked = "warn"

docs/gh-automation.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# GitHub CLI (gh) automation
2+
3+
Use `gh` from the terminal for issues, PRs, releases, and CI. See also [ROADMAP.md](ROADMAP.md) (issue labels, filters) and [release-process.md](release-process.md) (release steps).
4+
5+
## Prerequisites
6+
7+
- Install: <https://cli.github.com/>
8+
- Auth: `gh auth login`
9+
10+
## Issues
11+
12+
```bash
13+
# List (default: open, 30)
14+
gh issue list
15+
16+
# By label
17+
gh issue list --label "priority: high"
18+
gh issue list --label "area: review-pipeline"
19+
20+
# Search
21+
gh issue list --search "verification OR RAG"
22+
gh issue list --search "no:assignee sort:created-asc"
23+
24+
# View / edit
25+
gh issue view 32
26+
gh issue edit 32 --add-label "priority: medium"
27+
gh issue edit 32 --remove-label "help wanted"
28+
gh issue close 32 --comment "Fixed in #44"
29+
```
30+
31+
## Pull requests
32+
33+
```bash
34+
# List
35+
gh pr list
36+
gh pr list --state merged --limit 10
37+
38+
# Create (uses PR template)
39+
gh pr create --base main --title "feat: something" --body "Summary here. Closes #28"
40+
41+
# Status and merge
42+
gh pr view 46
43+
gh pr checks 46 # CI status
44+
gh pr checks 46 --watch # Watch until done
45+
gh pr merge 46 --squash
46+
gh pr merge 46 --merge
47+
```
48+
49+
## Releases and workflows
50+
51+
```bash
52+
# Trigger Prepare release (creates tag, runs Release workflow)
53+
gh workflow run "Prepare release" -f version=0.5.28
54+
55+
# List workflow runs
56+
gh run list
57+
gh run list --workflow "Release"
58+
59+
# Watch latest run
60+
gh run watch
61+
62+
# View run details and logs
63+
gh run view
64+
gh run view 12345 --log
65+
```
66+
67+
## One-line release from terminal
68+
69+
After version and RELEASE_NOTES are merged to main:
70+
71+
```bash
72+
./scripts/gh-release.sh 0.5.28
73+
# or
74+
gh workflow run "Prepare release" -f version=0.5.28
75+
```
76+
77+
## CI and runs
78+
79+
```bash
80+
# Download artifacts from latest run
81+
gh run download
82+
83+
# Re-run failed jobs
84+
gh run rerun <run-id> --failed
85+
```
86+
87+
## Quick reference
88+
89+
| Task | Command |
90+
|-------------------|--------|
91+
| Open issues by label | `gh issue list -l "priority: high"` |
92+
| Create PR | `gh pr create -B main -t "title" -b "body"` |
93+
| Merge PR | `gh pr merge <number> --squash` |
94+
| Close issue with comment | `gh issue close <number> --comment "Done in #44"` |
95+
| Run Prepare release | `gh workflow run "Prepare release" -f version=0.5.28` |
96+
| Watch CI | `gh pr checks <number> --watch` |

docs/release-process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ This doc and GitHub Actions make releases repeatable with minimal manual steps.
4242
| Step | Automation |
4343
|------|------------|
4444
| Version sync (CI) | `check_version_sync.py` fails if `Cargo.toml` is behind latest tag. |
45-
| Tag and trigger release | **Prepare release** workflow (manual run with version input). |
45+
| Tag and trigger release | **Prepare release** workflow (manual run with version input). From CLI: `./scripts/gh-release.sh 0.5.28` or `gh workflow run "Prepare release" -f version=0.5.28`. See [gh-automation.md](gh-automation.md). |
4646
| Release body | **Release** workflow reads `RELEASE_NOTES.md` for the tagged version. |
4747
| Binaries + Docker | **Release** workflow builds and uploads. |
4848
| Issue close | Add “Closes #N” in PR body. |

scripts/gh-release.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
# Trigger the "Prepare release" workflow from the CLI.
3+
# Usage: ./scripts/gh-release.sh 0.5.28
4+
# Prerequisites: Cargo.toml and charts/diffscope/Chart.yaml must already be at this version on main.
5+
6+
set -euo pipefail
7+
8+
VERSION="${1:-}"
9+
if [ -z "$VERSION" ]; then
10+
echo "Usage: $0 <version>" >&2
11+
echo "Example: $0 0.5.28" >&2
12+
exit 1
13+
fi
14+
15+
# Strip leading 'v' if present
16+
VERSION="${VERSION#v}"
17+
18+
echo "Triggering Prepare release for v$VERSION..."
19+
gh workflow run "Prepare release" -f version="$VERSION"
20+
echo "Run 'gh run watch' to follow the run."

0 commit comments

Comments
 (0)