Skip to content

Commit 8e6e93e

Browse files
authored
feat: add automatic v-prefix removal from release titles (#183)
* feat: add release-please configuration - Update .github/workflows/release-please.yml to use config-file approach - Add .release-please-config.json with terraform-module configuration - Add .release-please-manifest.json with current version 0.31.0 * fix: standardize release-please configuration and resolve issues - Pin googleapis/release-please-action to v4.2.0 commit hash for security - Pin Ubuntu runner to ubuntu-22.04 for reliability - Create tags without v-prefix for all existing versions to ensure CHANGELOG URLs work - Update CHANGELOG.md to remove v-prefix from compare URLs for consistency - Addresses Configuration Mismatch warning by normalizing tag format * feat: add automatic v-prefix removal from release titles - Add post-processing step to ensure clean release titles - Matches existing terraform-module configuration - Ensures consistent format between git tags and GitHub release titles - Only runs when release is actually created - Provides clear logging and smart detection logic This completes the standardization across all terraform repositories for consistent v-prefix handling in both tags and release titles.
1 parent f5c673c commit 8e6e93e

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.github/workflows/release-please.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,30 @@ jobs:
1515
id: release_please
1616
with:
1717
token: ${{ secrets.GITHUB_TOKEN }}
18-
config-file: .release-please-config.json
18+
config-file: .release-please-config.json
19+
20+
- name: Remove v-prefix from release title
21+
if: ${{ steps.release_please.outputs.release_created }}
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
# Get the release tag and current title
26+
RELEASE_TAG="${{ steps.release_please.outputs.tag_name }}"
27+
echo "Release tag: $RELEASE_TAG"
28+
29+
# Get current release info
30+
CURRENT_RELEASE=$(gh release view "$RELEASE_TAG" --json name,tagName --repo ${{ github.repository }})
31+
CURRENT_NAME=$(echo "$CURRENT_RELEASE" | jq -r '.name')
32+
echo "Current release name: $CURRENT_NAME"
33+
34+
# Check if the release title has v-prefix but tag doesn't
35+
if [[ "$CURRENT_NAME" =~ ^v[0-9] ]] && [[ ! "$RELEASE_TAG" =~ ^v[0-9] ]]; then
36+
# Remove v-prefix from release title to match the clean tag
37+
NEW_NAME="${CURRENT_NAME#v}"
38+
echo "Updating release title from '$CURRENT_NAME' to '$NEW_NAME'"
39+
40+
gh release edit "$RELEASE_TAG" --title "$NEW_NAME" --repo ${{ github.repository }}
41+
echo "✅ Release title updated successfully"
42+
else
43+
echo "ℹ️ No v-prefix found in release title or tag already has v-prefix - no changes needed"
44+
fi

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
56
## [0.32.0](https://github.com/lgallard/terraform-aws-backup/compare/0.31.0...0.32.0) (2025-07-23)
67

78

0 commit comments

Comments
 (0)