KChad's picture
merges from the other branch
5f8c2e8
name: Sync to Hugging Face hub
on:
push:
branches: [main]
workflow_dispatch:
jobs:
sync-to-hub:
runs-on: ubuntu-latest
if: ${{ secrets.HF_TOKEN != '' }}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Configure git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Push to hub
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_SPACE_REPO: ${{ vars.HF_SPACE_REPO }}
run: |
if [ -z "$HF_SPACE_REPO" ]; then
HF_SPACE_REPO="KumarChad/Prompt_Injection_env"
fi
git push --force "https://hf_user:${HF_TOKEN}@huggingface.co/spaces/${HF_SPACE_REPO}" HEAD:main