Skip to content

Commit dd876c9

Browse files
authored
Create auto-update.yml
1 parent 31aad17 commit dd876c9

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/auto-update.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Dependencies Automatic Update
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
update-autogen-files:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
pull-requests: write
10+
env:
11+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4.0.1
16+
- run: |
17+
rm package-lock.json
18+
npm i
19+
- run: |
20+
git switch -c autoupdate
21+
gh auth setup-git
22+
git config user.email "cicada1003@gmail.com"
23+
git config user.name "auto-update bot"
24+
git add .
25+
if [[ $(git diff --cached) ]]
26+
then
27+
git commit -m"Dependencies Auto Update"
28+
git push -u origin autoupdate
29+
fi
30+
PRS=$(gh pr list --json id -H autoupdate -s open)
31+
if [ "$PRS" == '[]' ]
32+
then
33+
gh pr create --base master --fill
34+
else
35+
echo "$PRS"
36+
fi

0 commit comments

Comments
 (0)