diff --git a/Gitea-tips-and-tricks-for-TAs.md b/Gitea-tips-and-tricks-for-TAs.md new file mode 100644 index 0000000..d5ae297 --- /dev/null +++ b/Gitea-tips-and-tricks-for-TAs.md @@ -0,0 +1,37 @@ + +## lfs and gitea actions + +bug: https://github.com/actions/checkout/issues/1830#issuecomment-2314758792 + +solution: checkout lfs object separately + +```yaml +name: Run JOJ3 on Push +on: [push] + +jobs: + run: + container: + image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:focs-ubuntu-latest-slim + volumes: + - /home/tt/.config:/home/tt/.config + - /home/tt/.cache:/home/tt/.cache + - /home/tt/.ssh:/home/tt/.ssh + steps: + - name: Check out repository code + uses: https://gitea.com/BoYanZh/checkout@focs + with: + fetch-depth: 0 + lfs: false + persist-credentials: 'true' + - name: Checkout lfs + run: | + git lfs install --local + AUTH=$(git config --local http.https://focs.ji.sjtu.edu.cn/.extraheader) + git config --local --unset http.https://focs.ji.sjtu.edu.cn/.extraheader + git config --local http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH" + git lfs pull + - name: run joj3 + run: | + sudo -E -u tt joj3 -conf-root /home/tt/.config/joj +```