-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-action
30 lines (29 loc) · 864 Bytes
/
github-action
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
name: update-branch
on:
# update the branch X every night
schedule:
- cron: '0 3 * * *'
# or update the branch X manually
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-20.04
steps:
- name: Checkout 🛎
# https://github.com/actions/checkout
uses: actions/checkout@v3
with:
# check out all branches
fetch-depth: 0
# use a personal access token to commit
# the merged code and trigger CI actions
token: ${{ secrets.GH_PAT }}
- name: Update Git branch X
run: |
git config user.name "Update branch"
git config user.email [email protected]
git checkout X
git merge main --no-edit -m "Merged main branch on $(date +%F)"
- name: Push the updated branch X
run: |
git push origin X