Skip to content

Update

Update #1803

Workflow file for this run

name: Update
on:
push:
paths:
- .github/workflows/update.yml
pull_request:
paths:
- .github/workflows/update.yml
schedule:
- cron: "25 23 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Checking Update
uses: "docker://perl:5.34"
with:
args: bash -c "cpanm JSON && ./update.sh"
- name: Commit
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
branch=update-$(date +"%Y-%m-%d-%H-%M-%S")
git config --global user.name "Ichinose Shogo"
git config --global user.email shogo82148@gmail.com
git switch -c "$branch"
git add .
git commit -m "Update $(date +"%Y-%m-%d %H:%M:%S")" || exit 0
git push -u origin "$branch"
curl -H "Authorization: token $GITHUB_TOKEN" \
-d "$(jq --arg branch "$branch" -n '{ "title": "Auto Update", "base": "main", "head": $branch }')" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/pulls"