Skip to content

Commit 43d435c

Browse files
committed
test: Update auto-merge PR workflow to latest actions
1 parent aa62653 commit 43d435c

File tree

2 files changed

+36
-34
lines changed

2 files changed

+36
-34
lines changed

.github/workflows/auto-create-pr.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Auto Create PR from dev to master
2+
3+
on:
4+
schedule:
5+
# 每周四北京时间21点触发(UTC时间13点)
6+
- cron: '0 13 * * 4'
7+
workflow_dispatch:
8+
9+
jobs:
10+
create-pr:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Install GitHub CLI
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y curl
20+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
21+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
22+
sudo apt-get update
23+
sudo apt-get install -y gh
24+
25+
- name: Create Pull Request
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
TZ: Asia/Shanghai
29+
run: |
30+
CURRENT_DATE=$(date +%Y.%m.%d)
31+
gh pr create \
32+
--base master \
33+
--head dev \
34+
--title "Automated PR $CURRENT_DATE" \
35+
--body "Automated PR created by GitHub Actions. Merge dev into master" \
36+
--label automated

.github/workflows/auto-merge-pr.yaml

-34
This file was deleted.

0 commit comments

Comments
 (0)