Dependencies Automatic Update #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.0.1 | |
- 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 -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 |