Skip to content

Commit a076581

Browse files
committed
fix: update Release Drafter configuration (#120)
* fix: update Release Drafter configuration URL * Remove dollar signs from Clang tool version variables
1 parent 8649224 commit a076581

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

.github/release-drafter.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,2 @@
1-
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
1+
# Configuration for Release Drafter: https://github.com/release-drafter/release-drafter
22
_extends: .github
3-
4-
# Override the template to include default tool versions
5-
template: |
6-
<!-- Optional: add a release summary here -->
7-
8-
## Default Clang Tools Versions for this release
9-
10-
- **clang-format**: `$CLANG_FORMAT_VERSION`
11-
- **clang-tidy**: `$CLANG_TIDY_VERSION`
12-
13-
You can override the default versions by adding the `--version` argument under `args` in your pre-commit configuration. For details, see [Custom Clang Tool Version](https://github.com/cpp-linter/cpp-linter-hooks?tab=readme-ov-file#custom-clang-tool-version)
14-
15-
$CHANGES
16-
17-
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

.github/workflows/release-drafter.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,36 @@ jobs:
3232
- name: Extract default tool versions
3333
id: versions
3434
run: |
35+
# Get versions from Python
3536
CLANG_FORMAT_VERSION=$(python -c "from cpp_linter_hooks.util import DEFAULT_CLANG_FORMAT_VERSION; print(DEFAULT_CLANG_FORMAT_VERSION)")
3637
CLANG_TIDY_VERSION=$(python -c "from cpp_linter_hooks.util import DEFAULT_CLANG_TIDY_VERSION; print(DEFAULT_CLANG_TIDY_VERSION)")
37-
echo "CLANG_FORMAT_VERSION=$CLANG_FORMAT_VERSION" >> $GITHUB_OUTPUT
38-
echo "CLANG_TIDY_VERSION=$CLANG_TIDY_VERSION" >> $GITHUB_OUTPUT
38+
39+
# Export to GitHub Actions environment for subsequent steps
40+
echo "CLANG_FORMAT_VERSION=$CLANG_FORMAT_VERSION" >> $GITHUB_ENV
41+
echo "CLANG_TIDY_VERSION=$CLANG_TIDY_VERSION" >> $GITHUB_ENV
42+
43+
# Log for debug
3944
echo "Default clang-format version: $CLANG_FORMAT_VERSION"
4045
echo "Default clang-tidy version: $CLANG_TIDY_VERSION"
4146
47+
# Generate release notes file
48+
echo "## 💡 Default Clang Tool Version" > release_notes.md
49+
echo "- clang-format: \`$CLANG_FORMAT_VERSION\`" >> release_notes.md
50+
echo "- clang-tidy: \`$CLANG_TIDY_VERSION\`" >> release_notes.md
51+
echo "" >> release_notes.md
52+
echo "You can override the default versions for this release by adding the \`--version\` argument under \`args\` in your pre-commit configuration. For details, see [Custom Clang Tool Version](https://github.com/cpp-linter/cpp-linter-hooks?tab=readme-ov-file#custom-clang-tool-version)" >> release_notes.md
53+
echo "" >> release_notes.md
54+
cat release_notes.md
55+
56+
# Export release notes content to env variable for Release Drafter
57+
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
58+
cat release_notes.md >> $GITHUB_ENV
59+
echo "EOF" >> $GITHUB_ENV
60+
4261
# Draft your next Release notes as Pull Requests are merged into the default branch
4362
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
4463
with:
4564
commitish: 'main'
65+
header: ${{ env.RELEASE_BODY }}
4666
env:
4767
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
CLANG_FORMAT_VERSION: ${{ steps.versions.outputs.CLANG_FORMAT_VERSION }}
49-
CLANG_TIDY_VERSION: ${{ steps.versions.outputs.CLANG_TIDY_VERSION }}

0 commit comments

Comments
 (0)