Skip to content

auto sync

auto sync #875

name: auto sync
on:
schedule:
- cron: "0 18 * * *"
workflow_dispatch:
env:
APP_ID: 229710
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: init python environment
run: |
sudo apt-get install python3-requests
# Install ssh key and known_hosts
- name: Git config
env:
SSH_KEY: ${{secrets.SYNC_SSH_KEY}}
KNOWN_HOSTS: ${{secrets.SYNC_SSH_KNOWN_HOSTS}}
run: |
mkdir ~/.ssh
echo "$KNOWN_HOSTS" > ~/.ssh/known_hosts
echo "$SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
git config --global user.name deepin-community-bot
git config --global user.email [email protected]
- name: sync workflow to all public repo
id: get-changed
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
git clone [email protected]:deepin-community/.github.git deepin-community.github
cd deepin-community.github
python3 scripts/update.py call-chatOps.yml backup-to-gitlab.yml call-auto-tag.yml
git add . && git commit -m "chore: sync workflow to all public repo" && git push || exit 0