-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (74 loc) · 2.59 KB
/
release_drafter.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
---
#
# Ansible managed
#
name: Release Drafter
on:
push:
# branches to consider in the event; optional, defaults to default
branches:
- master
- main
- dependabot/**
- renovate/**
- testing
paths-ignore:
- '**/README.md'
- '**/CHANGELOG.md'
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
pull_request_target:
permissions: write-all
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v6
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
with:
config-name: release-drafter.yml
disable-autolabeler: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
changelog_draft:
runs-on: ubuntu-latest
steps:
- name: Checkout dj-wasabi-release repo
uses: actions/checkout@v4
with:
repository: dj-wasabi/dj-wasabi-release
path: dj-wasabi-release
- name: Checkout current repo
uses: actions/checkout@v4
with:
path: ${{ github.event.repository.default_branch }}
- name: Commit Changelog file
run: |
# We are cloned in the 'default' directory and the dj-wasabi-release
# repository is the 'dj-wasabi-release' next to 'default'
cd ${{ github.event.repository.default_branch }}
# Generate CHANGELOG.md file
../dj-wasabi-release/release.sh -d
# Let commit the changes if there are any? (Well there should be!)
if [[ $(git status | grep -c 'CHANGELOG.md' || true) -gt 0 ]]
then echo "Committing file"
git config --global user.name 'Shadow Walker [GH bot]'
git config --global user.email '[email protected]'
git add CHANGELOG.md
git commit -m "Updated CHANGELOG.md on \"$(date "+%Y-%m-%d %H:%M:%S")\"" CHANGELOG.md
git push
fi
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}