Skip to content

Commit 71aa6a6

Browse files
authored
Create update-changelog.yaml (#1605)
* Create update-changelog.yaml * Create release-drafter.yml
1 parent be806dc commit 71aa6a6

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- master
8+
# pull_request event is required only for autolabeler
9+
pull_request:
10+
# Only following types are handled by the action, but one can default to all as well
11+
types: [opened, reopened, synchronize]
12+
# pull_request_target event is required for autolabeler to support PRs from forks
13+
# pull_request_target:
14+
# types: [opened, reopened, synchronize]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
update_release_draft:
21+
permissions:
22+
# write permission is required to create a github release
23+
contents: write
24+
# write permission is required for autolabeler
25+
# otherwise, read permission is required at least
26+
pull-requests: write
27+
runs-on: ubuntu-latest
28+
steps:
29+
# (Optional) GitHub Enterprise requires GHE_HOST variable set
30+
#- name: Set GHE_HOST
31+
# run: |
32+
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
33+
34+
# Drafts your next Release notes as Pull Requests are merged into "master"
35+
- uses: release-drafter/release-drafter@v6
36+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
37+
# with:
38+
# config-name: my-config.yml
39+
# disable-autolabeler: true
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
update:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
# Give the default GITHUB_TOKEN write permission to commit and push the
13+
# updated CHANGELOG back to the repository.
14+
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
15+
contents: write
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
ref: ${{ github.event.release.target_commitish }}
22+
23+
- name: Update Changelog
24+
uses: stefanzweifel/changelog-updater-action@v1
25+
with:
26+
latest-version: ${{ github.event.release.tag_name }}
27+
release-notes: ${{ github.event.release.body }}
28+
29+
- name: Commit updated CHANGELOG
30+
uses: stefanzweifel/git-auto-commit-action@v5
31+
with:
32+
branch: ${{ github.event.release.target_commitish }}
33+
commit_message: Update CHANGELOG
34+
file_pattern: CHANGELOG.md

0 commit comments

Comments
 (0)