Skip to content

Commit

Permalink
Merge pull request #10 from alisaitteke/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
alisaitteke authored Nov 23, 2024
2 parents 95c32f9 + e8b01f6 commit edd9b8c
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 12 deletions.
45 changes: 36 additions & 9 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Template for release name and tag
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

# master release notes template
template: |
## What's Changed
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
# Categories for grouping changes
categories:
- title: '🚀 Features'
labels:
Expand All @@ -14,25 +24,42 @@ categories:
labels:
- 'chore'
- 'dependencies'
- title: '📚 Documentation'
labels:
- 'documentation'
- 'docs'

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'

# Version increment rules based on PR labels
version-resolver:
major:
labels:
- 'major'
- 'breaking'
minor:
labels:
- 'minor'
- 'feature'
- 'enhancement'
patch:
labels:
- 'patch'
- 'fix'
- 'bugfix'
- 'bug'
- 'chore'
- 'dependencies'
- 'documentation'
default: patch

template: |
## Changes
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
# Labels to exclude from release notes
exclude-labels:
- 'skip-changelog'

# Template for individual changes
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'

# Text replacements in release notes
replacers:
- search: '/CVE-(\d{4})-(\d+)/g'
replace: 'CVE-$1-$2'
51 changes: 48 additions & 3 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,61 @@
# Automatically creates and updates release drafts when PRs are merged
name: Release Drafter

# Triggers the workflow on push to master and on PR activities
on:
push:
branches: [ master ]
pull_request:
types: [opened, reopened, synchronize]
branches: [ master ]
# Manual trigger option
workflow_dispatch:

# Define required permissions for the workflow
permissions:
# Required permissions for release and milestone management
contents: write # Allows creating releases
pull-requests: write # Allows reading and labeling PRs
issues: write # Allows managing related issues

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
# Checkout repository with full history
- uses: actions/checkout@v4
with:
config-name: release-drafter.yml
fetch-depth: 0

# Run release drafter action
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configuration options
config-name: release-drafter.yml # Path to config file
disable-autolabeler: false # Enable automatic PR labeling
tag-template: 'v$RESOLVED_VERSION' # Version tag format
version-template: '$MAJOR.$MINOR.$PATCH' # Version number format
publish: false # Create as draft only
prerelease: false # Mark as stable release
commitish: master # Target branch

# Optional: Update changelog file in repository
update_changelog:
needs: update_release_draft
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Update Changelog
run: |
if [ -f CHANGELOG.md ]; then
echo "Updating CHANGELOG.md"
# Add changelog update commands here if needed
else
echo "CHANGELOG.md not found"
fi

0 comments on commit edd9b8c

Please sign in to comment.