-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (36 loc) · 1.04 KB
/
scheduled.yml
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
38
39
name: scheduled-check-update
on:
workflow_dispatch:
#
schedule:
# check every 30 minutes
- cron: '30 * * * *'
jobs:
timed_update:
runs-on: ubuntu-latest
steps:
-
name: Action Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GHTK }} # use personal token to trigger action when push
-
name: Run script
id: update
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/script/timed_update.js')
return await script({github, context})
-
name: Commit
run: |
echo "Result: ${{steps.update.outputs.result}}"
if [[ "${{steps.update.outputs.result}}" == true ]]; then
git config user.name github-actions && \
git config user.email github-actions[bot]@users.noreply.github.com && \
git add . && \
git commit -m 'github action generated' && \
git push && \
echo 'Done'
fi