name: az-more-slots-sync-to-github run-name: on: schedule: - cron: '50 */3 * * *' issues: types: [opened] 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-more-slots.git ls -lh - name: az-more-slots run: | git clone https://github.com/Azurlane-HOI-mod/MoreSlots.git ls -lh cd MoreSlots ls -lh git checkout master rm -rf src rm -rf README mv ../az-more-slots/src . mv ../az-more-slots/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 MoreSlots 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: | ls -lh cd MoreSlots ls -lh 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/MoreSlots.git - name: cleanup run: | rm -rf az-more-slots ls -lh