-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (35 loc) · 958 Bytes
/
auto-update.yml
File metadata and controls
37 lines (35 loc) · 958 Bytes
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
37
name: Dependencies Automatic Update
on:
workflow_dispatch:
jobs:
update-autogen-files:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.2.0
- run: |
rm package-lock.json
npm i
- run: |
git switch -c autoupdate
gh auth setup-git
git config user.email "cicada1003@gmail.com"
git config user.name "auto-update bot"
git add .
if [[ $(git diff --cached) ]]
then
git commit -m"Dependencies Auto Update"
git push -f -u origin autoupdate
fi
PRS=$(gh pr list --json id -H autoupdate -s open)
if [ "$PRS" == '[]' ]
then
gh pr create --base master --fill
else
echo "$PRS"
fi