Skip to content

Commit

Permalink
Merge pull request #78 from leanix/feature/CID-1614/automatic-release…
Browse files Browse the repository at this point in the history
…-notes

CID-1614: Automatic release notes, added pull request template
  • Loading branch information
mohamedlajmileanix authored Oct 26, 2023
2 parents 7501fc8 + 2f11d78 commit cf67d65
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE (#$NUMBER)'
change-title-escapes: '\<*_&'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
$CHANGES
35 changes: 35 additions & 0 deletions .github/workflows/release-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ on:
workflow_dispatch:

jobs:
release_draft:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
runs-on: ubuntu-latest

Expand All @@ -17,9 +27,34 @@ jobs:
uses: K-Phoen/semver-release-action@master
with:
release_branch: main
release_strategy: tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Release Draft
uses: actions/github-script@v6.4.1
if: (steps.tag-action.outputs.tag != '')
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const tag = "${{ steps.tag-action.outputs.tag }}";
const { data: releases } = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
});
const draftRelease = releases.find(release => release.tag_name === tag && release.draft === true);
if (!draftRelease) {
console.log(`No draft release found for tag ${tag}`);
return;
}
await github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: draftRelease.id,
draft: false
});
console.log(`Published draft release for tag ${tag}`);
- name: Inject secret store credentials
uses: leanix/secrets-action@master
if: (steps.tag-action.outputs.tag != '')
Expand Down
26 changes: 26 additions & 0 deletions docs/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## 🛠 Changes made
Please explain here the changes you made in this PR.

## ✨ Type of change
Please delete the options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## 🧪 How Has This Been Tested?
Please describe the tests that you ran to verify your changes.

- [ ] Test A
- [ ] Test B
- [ ] 👌 No tests required
- [ ] 🚨 No tests Deployed

## 🏎 Checklist:
- [ ] My code follows the style guidelines
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I have made corresponding changes to the documentation (README.md)
- [ ] My commit message clearly reflects the changes made
- [ ] Assigned the appropriate labels (version, PR type, etc.)

0 comments on commit cf67d65

Please sign in to comment.