-
Notifications
You must be signed in to change notification settings - Fork 10
86 lines (76 loc) · 3.1 KB
/
release-notes.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
on:
milestone:
types: [closed]
workflow_dispatch:
inputs:
milestoneId:
description: 'Id of Milestone'
type: number
required: true
default: 10
name: Milestone Release Notes
jobs:
create-release-notes:
runs-on: ubuntu-latest
env:
OUTPUT_FOLDER: temp_release_notes
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PAT: ${{ secrets.GH_PAT }}
steps:
- uses: actions/checkout@master
- name: Prepare Settings
id: settings
run: |
echo "# env and var" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
_user=${{ github.actor }}
echo "- ACTION_NAME=$_user" >> "$GITHUB_STEP_SUMMARY"
echo "ACTION_NAME=$_user" >> "$GITHUB_OUTPUT"
_mail=${{ format('{0}+{1}@users.noreply.github.com', github.actor_id, github.actor) }}
echo "- ACTION_MAIL=$_mail" >> "$GITHUB_STEP_SUMMARY"
echo "ACTION_MAIL=$_mail" >> "$GITHUB_OUTPUT"
_owner=${{ github.repository_owner }}
echo "- OWNER=$_owner" >> "$GITHUB_STEP_SUMMARY"
echo "OWNER=$_owner" >> "$GITHUB_OUTPUT"
_repo=$(basename ${{ github.repository }})
echo "- REPO_NAME=$_repo" >> "$GITHUB_STEP_SUMMARY"
echo "REPO_NAME=$_repo" >> "$GITHUB_OUTPUT"
_id=${{ inputs.milestoneId }}
if [ "$_id" == "" ]; then
_file=${{ github.event.milestone.title }}
else
_file=$(curl -s -H "Authorization: token $GH_PAT" https://api.github.com/repos/$_owner/$_repo/milestones/$_id | jq -r '.title')
fi
echo "- FILE_NAME=$_file" >> "$GITHUB_STEP_SUMMARY"
echo "FILE_NAME=$_file" >> "$GITHUB_OUTPUT"
# https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md
cat > .github/release-notes.yml << "EOF"
changelog:
issues:
exclude:
labels: [ "duplicate", "invalid", "investigate", "pending", "question", "wontfix" ]
sections:
- title: "⭐ New Features"
labels: [ "feature" ]
- title: "🐞 Bug Fixes"
labels: [ "bug" ]
- title: "💎 Enhancements"
labels: [ "better", "devops", "quality" ]
- title: "📝 Documentation"
labels: [ "docs" ]
- title: "📦️ Dependencies"
labels: [ "deps" ]
EOF
- name: Create Release Notes
uses: docker://decathlon/release-notes-generator-action:latest
env:
FILENAME_PREFIX: Milestone-
FILENAME: ${{ steps.settings.outputs.FILE_NAME }}
- name: Upload Release Notes to Wiki
uses: docker://decathlon/wiki-page-creator-action:latest
env:
ACTION_MAIL: ${{ steps.settings.outputs.ACTION_MAIL }}
ACTION_NAME: ${{ steps.settings.outputs.ACTION_NAME }}
MD_FOLDER: ${{ env.OUTPUT_FOLDER }}
OWNER: ${{ steps.settings.outputs.OWNER }}
REPO_NAME: ${{ steps.settings.outputs.REPO_NAME }}