forked from sunpy/sunpy
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.36 KB
/
changelog_bot.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
name: Changelog Bot
on:
pull_request_target:
types: [opened, reopened, edited, labeled, unlabeled]
branches:
- main
env:
BOT_USER_NAME: 'SunPyBot'
BOT_USER_EMAIL: 'bot@sunpy.org'
jobs:
update-changelog:
if: "!contains(github.event.pull_request.labels.*.name, 'No Changelog Entry Needed')"
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Setup Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Find and write changelog
run: python tools/write_changelog_entry.py
env:
PR_NUMBER: ${{ github.event.number }}
PR_BODY: ${{ github.event.pull_request.body }}
BOT_AUTHOR: ${{ env.BOT_USER_NAME }} <${{ env.BOT_USER_EMAIL }}>
- name: Commit changelog
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[skip ci] Add changelog'
add_options: '-A'
disable_globbing: true
file_pattern: 'changelog/*.rst'
commit_user_name: ${{ env.BOT_USER_NAME }}
commit_user_email: ${{ env.BOT_USER_EMAIL }}
commit_author: ${{ env.BOT_USER_NAME }} <${{ env.BOT_USER_EMAIL }}>