forked from Lassebq/WrappedJSONGen
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.88 KB
/
update.yaml
File metadata and controls
56 lines (53 loc) · 1.88 KB
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
51
52
53
54
55
56
name: Update BetterJSONs
on:
workflow_dispatch:
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: "30 17 * * 3"
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v4
- name: Build with Gradle
run: ./gradlew build
- name: Checkout BetterJSONs repo
uses: actions/checkout@v4
with:
repository: MCPHackers/BetterJSONs
path: BetterJSONs
ssh-key: ${{ secrets.BETTERJSONS_SSH }}
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Run update
env:
CI_COMMIT_MESSAGE: Automatic update
CI_COMMIT_AUTHOR: github-actions[bot]
CI_COMMIT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
shell: bash
run: |
cd BetterJSONs
git pull
java -jar ../build/libs/versionjsons-1.0-all.jar --path ./jsons --generateManifest
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
if [[ `git status --porcelain --untracked-files=no` ]]; then
# Changes
git add .
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push
else
# No changes
echo "no changes to latest posts"
exit 0
fi