47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: az-vnr-patch-sync-to-github
|
|
run-name:
|
|
on:
|
|
schedule:
|
|
- cron: '20 */3 * * *'
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: clone
|
|
run: |
|
|
git clone https://x-access-token:${{ secrets.ACCESS_TOKEN }}@git.azw.net.cn/azurlane-hoi4/az-vnr-patch.git
|
|
ls -lh
|
|
- name: az-vnr-patch
|
|
run: |
|
|
git clone https://github.com/Azurlane-HOI-mod/VNR-Patch.git
|
|
ls -lh
|
|
cd VNR-Patch
|
|
ls -lh
|
|
git checkout master
|
|
rm -rf src
|
|
rm -rf README
|
|
mv ../az-vnr-patch/src .
|
|
mv ../az-vnr-patch/README .
|
|
git config --local user.email Cheshire[bot]@users.noreply.github.com
|
|
git config --local user.name 柴郡[bot]
|
|
- name: check diff
|
|
id: check_changes
|
|
run: |
|
|
ls -lh
|
|
cd VNR-Patch
|
|
ls -lh
|
|
if [ -z "$(git status --porcelain)" ]; then
|
|
echo "::set-output name=has_changes::false"
|
|
else
|
|
echo "::set-output name=has_changes::true"
|
|
fi
|
|
- name: push
|
|
if: ${{ steps.check_changes.outputs.has_changes == 'true' }}
|
|
run: |
|
|
git add .
|
|
git commit --allow-empty -m "$(date '+%Y-%m-%d %H:%M:%S')"
|
|
git push https://x-access-token:${{ secrets.AZW_PHY_ACCESS_TOKEN }}@github.com/Azurlane-HOI-mod/VNR-Patch.git
|
|
- name: cleanup
|
|
run: |
|
|
rm -rf az-vnr-patch
|
|
ls -lh |