forked from aws-powertools/powertools-lambda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (36 loc) · 1.33 KB
/
reusable_publish_changelog.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
name: Build and publish latest changelog
# see ./.github/workflows/build_changelog.yml for docs
on:
workflow_call:
env:
TEMP_BRANCH_PREFIX: "ci-changelog"
PULL_REQUEST_TITLE: "chore(ci): changelog rebuild"
FILES_TO_COMMIT: "CHANGELOG.md"
permissions:
contents: read
jobs:
publish_changelog:
if: github.repository == 'aws-powertools/powertools-lambda-python'
# Force Github action to run only a single job at a time (based on the group name)
# This is to prevent race-condition and inconsistencies with changelog push
concurrency:
group: changelog-build
runs-on: ubuntu-latest
permissions:
contents: write # create temporary branch with changelog
pull-requests: write # create PR
steps:
- name: Checkout repository # reusable workflows start clean, so we need to checkout again
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: "Generate latest changelog"
run: make changelog
- name: Create PR
id: create-pr
uses: ./.github/actions/create-pr
with:
files: ${{ env.FILES_TO_COMMIT }}
temp_branch_prefix: ${{ env.TEMP_BRANCH_PREFIX }}
pull_request_title: ${{ env.PULL_REQUEST_TITLE }}
github_token: ${{ secrets.GITHUB_TOKEN }}