-
Notifications
You must be signed in to change notification settings - Fork 7
84 lines (78 loc) · 2.96 KB
/
update-changelog.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# This workflow is triggered from other repositories in the Bucketeer Organization
# to update the CHANGELOG SDKs pages.
# In case of changes in the template (`update-changelog.sh`), we also might need to update the trigger side.
name: update-changelog
on:
workflow_dispatch:
inputs:
doc_filename:
description: "Doc filename"
type: string
required: true
doc_filepath:
description: "Doc filepath"
type: string
required: true
doc_title:
description: "Doc title"
type: string
required: true
doc_slug:
description: "Doc slug"
type: string
required: true
changelog_url:
description: "Changelog URL"
type: string
required: true
from_repository_name:
description: "From repository name"
type: string
required: true
from_repository_url:
description: "From repository URL"
type: string
required: true
commit_url:
description: "Commit URL"
type: string
required: true
release_tag:
description: "Release Tag"
type: string
required: true
jobs:
create-and-merge-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update the CHANGELOG.md file
env:
DOC_FILENAME: ${{ github.event.inputs.doc_filename }}
DOC_FILEPATH: ${{ github.event.inputs.doc_filepath }}
DOC_TITLE: ${{ github.event.inputs.doc_title }}
DOC_SLUG: ${{ github.event.inputs.doc_slug }}
CHANGELOG_URL: ${{ github.event.inputs.changelog_url }}
run: ./hack/update-changelog.sh
- name: Create the pull request
id: create-docs-pull-request
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
token: ${{ secrets.ACTIONS_PAT }}
committer: bucketeer-bot <[email protected]>
author: bucketeer-bot <[email protected]>
commit-message: "docs: update ${{ github.event.inputs.doc_filename }} to ${{ github.event.inputs.release_tag }}"
title: "docs: update ${{ github.event.inputs.doc_filename }} changelog to ${{ github.event.inputs.release_tag }}"
body: "[${{ github.event.inputs.from_repository_name }}](${{ github.event.inputs.from_repository_url }}) commit: ${{ github.event.inputs.commit_url }}"
branch: "ci-docs-pr-${{ github.event.inputs.release_tag }}"
delete-branch: true
labels: automerge
- name: Merge the pull request
id: automerge
uses: pascalgn/automerge-action@d1203c0bf94a827b991e5de69d662e9163304fa0 # v0.16.3
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_PAT }}
PULL_REQUEST: ${{ steps.create-docs-pull-request.outputs.pull-request-number }}
MERGE_LABELS: automerge
MERGE_METHOD: squash
MERGE_ERROR_FAIL: true