This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (46 loc) · 1.5 KB
/
main.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
40
41
42
43
44
45
46
47
48
49
50
on:
workflow_dispatch:
schedule:
- cron: "*/5 * * * *"
jobs:
update:
runs-on: ubuntu-latest
name: Update
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Cache Repository
uses: actions/cache@v4
with:
path: ${{ github.workspace }}
key: ${{ runner.os }}-workspace
- name: Checkout This
uses: actions/checkout@v4
with:
# Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }}
repository: ${{ github.repository }}
# Relative path under $GITHUB_WORKSPACE to place the repository
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# Default: 1
fetch-depth: 0
# Relative path under $GITHUB_WORKSPACE to place the repository
path: '.'
- name: Update Data
uses: './'
- name: Setup Commit This
run: |
git config --local user.email "[email protected]"
git config --local user.name "UST Bot"
git add .
- name: Commit This
continue-on-error: true
run: |
now=$(TZ=Asia/Hong_Kong date --iso-8601=seconds)
git commit -a -m "update: $now"
- name: Push This
uses: ad-m/github-push-action@master
with:
directory: ${{ github.workspace }}