add a ci job sync readme to huggingface repos #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync README to Hugging Face Hub | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
sync-readme: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
repo: ['test'] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Sync README for ${{ matrix.repo }} | |
run: | | |
git clone https://huggingface.co/shiyue-loop/${{ matrix.repo }} | |
cp HUGGINGFACE_README.md ${{ matrix.repo }}/README.md | |
cd ${{ matrix.repo }} | |
git config --global user.email "bot@01.ai" | |
git config --global user.name "01-ai-bot" | |
# Check for changes | |
if git diff --quiet; then | |
echo "No changes to commit for ${{ matrix.repo }}" | |
else | |
git add README.md | |
git commit -m "Sync README" | |
git push https://shiyue-loop:${{ secrets.HF_TOKEN }}@huggingface.co/shiyue-loop/${{ matrix.repo }} | |
fi |