mirror of
https://github.com/benjaminjacobreji/standardnotes-extensions.git
synced 2026-02-03 02:44:00 +08:00
Add auto update GitHub Action
This commit is contained in:
committed by
GitHub
parent
7af11efb3e
commit
dbd8db6d48
46
.github/workflows/update-extensions.yml
vendored
Normal file
46
.github/workflows/update-extensions.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Update Extensions to their lastest version
|
||||
on:
|
||||
schedule:
|
||||
# ┌───────────── minute (0 - 59)
|
||||
# │ ┌───────────── hour (0 - 23)
|
||||
# │ │ ┌───────────── day of the month (1 - 31)
|
||||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
||||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# * * * * *
|
||||
- cron: '*/5 * * * *'
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout@v2
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup-Python@v2
|
||||
uses: actions/setup-python@v2
|
||||
|
||||
- name: Update Extensions
|
||||
run: python update.py
|
||||
|
||||
- name: Commit Changes
|
||||
shell: bash
|
||||
run: |
|
||||
git remote set-url origin ${{ secrets.ssh }}
|
||||
git status
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
git add -A
|
||||
git commit -m "Auto updating extensions"
|
||||
git fetch origin main
|
||||
git push origin HEAD:main
|
||||
else
|
||||
echo "No extension updates. Exiting... ";
|
||||
fi
|
||||
Reference in New Issue
Block a user