-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (31 loc) · 1.25 KB
/
Copy pathmerge-change-log-to-main.yml
File metadata and controls
34 lines (31 loc) · 1.25 KB
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
name: Merge change log to main
on:
workflow_dispatch:
jobs:
create-pull-request:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
# this workflow is run against the release branch (see usage of GITHUB_REF_NAME below)
# but it is creating a pull request against main
ref: main
# history is needed to run format-patch below
fetch-depth: 0
- name: Set git user
run: |
git config user.name opentelemetry-java-bot
git config user.email 97938252+opentelemetry-java-bot@users.noreply.github.com
# this will fail if there have been conflicting change log updates introduced in main
- name: Create pull request against main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git format-patch --stdout HEAD..origin/$GITHUB_REF_NAME CHANGELOG.md | git apply
msg="Merge change log updates from $GITHUB_REF_NAME to main"
git commit -a -m "$msg"
git push origin HEAD:merge-change-log-updates-to-main
gh pr create --title "$msg" \
--body "$msg" \
--head merge-change-log-updates-to-main \
--base main