-
Notifications
You must be signed in to change notification settings - Fork 93
58 lines (53 loc) · 2.03 KB
/
changelog_pr.yaml
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
name: Offline Changelog
on:
release:
types:
- published
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
chanagelog-pr:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
runs-on: ubuntu-24.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: heinrichreimer/github-changelog-generator-action@e60b5a2bd9fcd88dadf6345ff8327863fb8b490f # v2.4
with:
token: ${{ secrets.CR_TOKEN }}
project: k8gb
output: CHANGELOG-latest.md
pullRequests: true
author: true
issues: true
issuesWoLabels: true
prWoLabels: true
onlyLastTag: true
compareLink: true
filterByMilestone: true
unreleased: false
- name: Prepend the latest changes to CHANGELOG.md
run: |
mv CHANGELOG.md CHANGELOG-old.md
cat CHANGELOG-latest.md | sed -e'$d' > CHANGELOG.md
cat CHANGELOG-old.md | sed -e'1,2d' >> CHANGELOG.md
rm CHANGELOG-old.md CHANGELOG-latest.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
title: "Update Offline Changelog"
branch: offline_changelog
delete-branch: true
base: master
signoff: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Send http get to doc.crds.dev to index a new version
run: |
curl -sL https://doc.crds.dev/github.com/k8gb-io/k8gb@${{ github.event.release.tag_name }} | grep -A2 'class="container"'