-
Notifications
You must be signed in to change notification settings - Fork 6
117 lines (99 loc) · 3.78 KB
/
action-github-changelog-generator.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Generate changelog
on:
release:
types: [published]
# pull_request:
# types: [closed]
# issues:
# types: [closed, edited]
# pull_request: # This line is for test purpose only.
# types: [opened, synchronize, reopened, labeled, unlabeled] # This line is for test purpose only.
jobs:
generate-changelog:
runs-on: ubuntu-latest
name: Generate changelog for master branch
steps:
- uses: actions/checkout@v4
- name: Generate changelog
uses: heinrichreimer/[email protected]
with:
output: CHANGELOG-generated.md
# token: ${{ secrets.GITHUB_TOKEN }}
# - name: Organize files
# run: |
# mv CHANGELOG.md CHANGELOG-generated.md
# git checkout -- CHANGELOG.md || echo "There was no CHANGELOG.md to recover"
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.CHANGELOG_GENERATOR_PAT }}
commit-message: Update CHANGELOG-generated.md
committer: cb-bot <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: generate-changelog
base: master
delete-branch: true
title: '[Workflow] Update CHANGELOG-generated.md'
body: |
Update CHANGELOG-generated.md
- Updated with *today's* date
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: |
changelog
automated pr
assignees: jihoon-seo
reviewers: jihoon-seo
team-reviewers: |
owners
maintainers
draft: false
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.create-pull-request.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.create-pull-request.outputs.pull-request-url }}"
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Dump strategy context
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: echo "$STRATEGY_CONTEXT"
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
# - name: Commit files
# env:
# CI_USER: cb-bot #${{ secrets.YOUR_GITHUB_USER }}
# CI_EMAIL: [email protected] #${{ secrets.YOUR_GITHUB_EMAIL }}
# run: |
# git config --local user.email "$CI_EMAIL"
# git config --local user.name "$CI_USER"
# mv CHANGELOG.md CHANGELOG-generated.md
# git checkout -- CHANGELOG.md
# git add CHANGELOG-generated.md && git commit -m 'Updated CHANGELOG-generated.md' && echo "push=true" >> $GITHUB_ENV || echo "No changes to CHANGELOG-generated.md"
# - name: Push changes
# if: env.push == 'true'
# env:
# CI_USER: cloud-barista-hub #${{ secrets.YOUR_GITHUB_USER }}
# CI_TOKEN: ${{ secrets.CHANGELOG_GENERATOR_PAT }}
# run: |
# git fetch origin master
# git rebase origin/master
# git push "https://$CI_USER:[email protected]/$GITHUB_REPOSITORY.git" HEAD:master