-
Notifications
You must be signed in to change notification settings - Fork 44
36 lines (34 loc) · 1.22 KB
/
upmerge.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
name: Upmerge docs to edge
on:
workflow_dispatch:
jobs:
upmerge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_RAD_CI_BOT_PAT }}
ref: edge
- name: Configure git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Radius CI Bot"
- name: Create new branch
run: |
export DATE=$(date +%Y-%m-%d) >> $GITHUB_ENV
git checkout -b upmerge/$DATE
- name: Upmerge docs
run: |
export SOURCE_BRANCH=$(basename ${{ github.ref }})
echo "Upmerging docs from $SOURCE_BRANCH to edge"
git fetch origin $SOURCE_BRANCH
git merge --no-commit origin/$SOURCE_BRANCH
git reset HEAD docs/config.toml docs/layouts/partials/hooks/body-end.html
- name: Commit changes
run: |
git commit -m "Upmerge to edge"
git push --set-upstream origin upmerge/$DATE
- name: Create pull request
env:
GITHUB_TOKEN: ${{ secrets.GH_RAD_CI_BOT_PAT}}
run: gh pr create --title "Upmerge to edge" --body "Upmerge to edge" --base edge --head upmerge/$DATE