Files
remote-to-github-mirror/.gitea/workflows/tj-sync.yml
azw 60a6bbf4fc
Some checks failed
az-vnr-patch-sync-to-github / build (push) Failing after 4s
sr-sync-to-github / build (push) Successful in 1m5s
az-more-slots-sync-to-github / build (push) Successful in 4s
tj-sync-to-github / build (push) Successful in 1m6s
1
2024-12-15 18:18:35 +08:00

50 lines
1.4 KiB
YAML

name: tj-sync-to-github
run-name:
on:
schedule:
- cron: '5 */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/azurlane-tj.git
ls -lh
- name: tj
run: |
git clone https://github.com/Azurlane-HOI-mod/Azurlane-TJ.git
ls -lh
cd Azurlane-TJ
ls -lh
git checkout master
rm -rf src
rm -rf README
mv ../azurlane-tj/src .
mv ../azurlane-tj/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 Azurlane-TJ
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/Azurlane-TJ.git
- name: cleanup
run: |
rm -rf azurlane-tj
ls -lh