Repository navigation
Add draft-release composite action - #87
Yaswant Pradhan (yaswant) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a reusable draft-release composite GitHub Action to generate categorised draft release notes (using a shared changelog template) and create/update a draft GitHub Release for the current tag.
Changes:
- Adds a composite action (
draft-release/action.yaml) that checks out the caller repo, compiles release notes, and drafts/updates a GitHub Release. - Adds a release-changelog category template (
draft-release/templates/release.yml) plus documentation (draft-release/README.md). - Updates Markdown lint configuration in
pyproject.tomlto allow Markdown constructs used by the new README.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Adjusts rumdl rule disables to accommodate new Markdown content. |
| draft-release/templates/release.yml | Defines changelog categories and excluded labels for release note generation. |
| draft-release/README.md | Documents the draft-release action, categories, usage, permissions, and outputs. |
| draft-release/bin/compile-release-notes.sh | Implements release note compilation from tags/commits and merged PR metadata. |
| draft-release/action.yaml | Defines the composite action steps to compile notes and create/edit draft releases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| name: Shared Global Release Engine | ||
| description: Automates draft releases using centralised assets | ||
|
|
||
| runs: |
| The compile step exposes: | ||
|
|
||
| - `has_commits`: `true` when release notes were generated from commits, | ||
| otherwise `false`. |
Andrew Coughtrie (andrewcoughtrie)
left a comment
There was a problem hiding this comment.
Would the plan be for this to trigger on creation of a tag on the repo? or by some other mechanism? If so, what conditions of tag creation would trigger this?
Otherwise looks like a good change overall, a couple of suggestions requests but otherwise I'm happy. Can't really test it and I think we should probably do so quite thoroughly on the git_playgound repo before deploying to LFRic Apps etc.
| "\(.merge_commit_sha) \(.number) \(.title) | \(.user.login) | \([.labels[].name] | join(",")) | \(.author_association)"' >recent-prs.txt | ||
|
|
||
| # Filter recent-prs down to ONLY those matching a commit SHA from our release range | ||
| awk 'NR==FNR { shas[tolower($1)]=1; next } (tolower($1) in shas) { print }' commit-shas.txt recent-prs.txt >pr-data.txt |
There was a problem hiding this comment.
We should probably check that we aren't missing any PRs, it looks like we would only get the last 200 we are probably safe at the moment but one day 200+ PRs in a release might happen and we want to catch that, checking that first commit after the previous release has been caught in the PR list would be useful and atm probably just failing with a safe message would be fine.
| while IFS= read -r raw_line; do | ||
| line="${raw_line%%#*}" | ||
| trimmed="${line#"${line%%[![:space:]]*}"}" | ||
| trimmed="${trimmed%"${trimmed##*[![:space:]]}"}" | ||
| [ -z "$trimmed" ] && continue | ||
|
|
||
| case "$trimmed" in | ||
| changelog:) continue ;; | ||
| categories: | exclude:) | ||
| mode="${trimmed%?}" | ||
| in_category_labels=0 | ||
| continue | ||
| ;; | ||
| labels:) | ||
| case "$mode" in | ||
| categories) [ "$current_index" -ge 0 ] && in_category_labels=1 ;; | ||
| exclude) in_category_labels=2 ;; | ||
| esac | ||
| continue | ||
| ;; | ||
| esac | ||
|
|
||
| if [ "$mode" = "categories" ] && [[ "$trimmed" =~ ^-[[:space:]]title:[[:space:]]*\"(.*)\"$ ]]; then | ||
| CATEGORY_TITLES+=("${BASH_REMATCH[1]}") | ||
| CATEGORY_LABELS+=("") | ||
| current_index=$((current_index + 1)) | ||
| in_category_labels=0 | ||
| continue | ||
| fi | ||
|
|
||
| if [ "$in_category_labels" -eq 1 ] && [[ "$trimmed" =~ ^-[[:space:]]+\"?([A-Za-z0-9._-]+)\"?\;?$ ]]; then | ||
| lbl="${BASH_REMATCH[1],,}" | ||
| if [ -z "${CATEGORY_LABELS[$current_index]}" ]; then | ||
| CATEGORY_LABELS[current_index]="$lbl" | ||
| else | ||
| CATEGORY_LABELS[current_index]+="|$lbl" | ||
| fi | ||
| continue | ||
| fi | ||
|
|
||
| if [ "$in_category_labels" -eq 2 ] && [[ "$trimmed" =~ ^-[[:space:]]+\"?([A-Za-z0-9._-]+)\"?\;?$ ]]; then | ||
| EXCLUDE_LABELS+=("${BASH_REMATCH[1],,}") | ||
| continue | ||
| fi | ||
| done <"$TEMPLATE_FILE" |
There was a problem hiding this comment.
Can we have a few more comments here please to describe what the code is doing (Copilot will probably do a good job of adding them), it's very hard to read regex's.
|
|
||
| # (build) Changes affecting build tools or external compiler toolchains. | ||
| # (chore) General housekeeping, license updates, or minor administrative tasks. | ||
| # (ci) Changes to GitHub Actions workflows, CI/CD pipelines, or other automation. |
There was a problem hiding this comment.
Include suites here?
| # (ci) Changes to GitHub Actions workflows, CI/CD pipelines, or other automation. | |
| # (ci) Changes to GitHub Actions workflows, CI/CD pipelines, suites, or other automation. |
| - title: "⚠️ Deprecations" | ||
| labels: | ||
| - "deprecated" |
There was a problem hiding this comment.
Do we need a similar label for removal of functionality?
| classDef trigger style fill:#f9f,stroke:#333,stroke-width:2px,font-weight:bold; | ||
| classDef step style fill:#bbf,stroke:#333,stroke-width:1px; | ||
| classDef desc style fill:#fff,stroke:#666,stroke-width:1px,stroke-dasharray: 5 5,font-size:12px; |

PR Summary
Add draft release composite action tailored for the Simulation Systems
Code Reviewer: Andrew Coughtrie (@andrewcoughtrie)
✅ Code Quality Checklist
(Some checks are automatically carried out via the CI pipeline)
🤖 AI Assistance and Attribution
💻 Code Review