-
Notifications
You must be signed in to change notification settings - Fork 6
36 lines (32 loc) · 1.07 KB
/
release-changelog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Release Changelog
on:
pull_request:
branches:
- master
types: [opened, synchronize]
jobs:
release-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Important pour s'assurer que tous les commits sont récupérés
- name: Generate changelog
id: generate_changelog
run: |
npm install -g conventional-changelog-cli
conventional-changelog -p angular -i CHANGELOG.md -s -r 0
CHANGELOG=$(cat CHANGELOG.md)
# Formatage pour Markdown (commentaire GitHub)
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=changelog::$CHANGELOG"
- name: Comment on PR
uses: thollander/actions-comment-pull-request@v1
with:
message: |
## Changelog
${{ steps.generate_changelog.outputs.changelog }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}