Skip to content

Update version JSON #941

Update version JSON

Update version JSON #941

Workflow file for this run

name: Update version JSON
on:
workflow_dispatch:
schedule:
- cron: '25 3 * * *'
jobs:
generate-update-json:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Update Json
run: ./scripts/run-script.sh UpdateJson
- name: Commit changes
if: ${{ env.COMMIT_CHANGE == 'true' }}
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "[BOT] Update version json"
- name: Publish changes
if: ${{ env.COMMIT_CHANGE == 'true' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Sync to Gitee
if: ${{ env.COMMIT_CHANGE == 'true' }}
run: |
mkdir -p ~/gitee/.ssh
echo "$INPUT_SSH_PRIVATE_KEY" > ~/gitee/.ssh/id_rsa
chmod 600 ~/gitee/.ssh/id_rsa
export GIT_SSH_COMMAND="ssh -v -i ~/gitee/.ssh/id_rsa -o StrictHostKeyChecking=no -F /dev/null"
git push --mirror "$INPUT_TARGET_REPO_URL"
env:
INPUT_SSH_PRIVATE_KEY:
${{ secrets.GITEE_SYNC_BOT_PRIVATE_KEY }}
INPUT_TARGET_REPO_URL:
[email protected]:Glavo/HMCL-Update.git