diff --git a/.github/workflows/push-plots-to-paper.yml b/.github/workflows/push-plots-to-paper.yml index b0e5aedca0..cf57b1206e 100644 --- a/.github/workflows/push-plots-to-paper.yml +++ b/.github/workflows/push-plots-to-paper.yml @@ -4,7 +4,6 @@ on: push: branches: - main # Set this to match the branch name you use - - automatic_plot_upload jobs: update-overleaf: @@ -12,30 +11,41 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Git Config run: | git config --global user.email "github-cicd-bot@example.com" git config --global user.name "GitHub CI/CD Bot" - - name: Clone Overleaf Repository + - name: Setup .netrc for Git authentication env: - OVERLEAF_GIT_REPO: ${{ secrets.OVERLEAF_REPO_URL }} OVERLEAF_TOKEN: ${{ secrets.OVERLEAF_TOKEN }} run: | - echo "machine git.overleaf.com login $OVERLEAF_TOKEN password" > ~/.netrc - git clone $OVERLEAF_GIT_REPO ../AST-Merging-Evaluation-Paper + cat << EOF > $HOME/.netrc + machine git.overleaf.com + login $OVERLEAF_TOKEN + password x-oauth-basic + EOF + chmod 600 $HOME/.netrc + + - name: Create directory for Overleaf Repository + run: mkdir -p ${{ github.workspace }}/AST-Merging-Evaluation-Paper - - name: Copy plots to Overleaf repository + - name: Clone Overleaf Repository + env: + OVERLEAF_GIT_REPO: ${{ secrets.OVERLEAF_REPO_URL }} run: | - mkdir -p ../AST-Merging-Evaluation-Paper/plots - cp path/to/plots/* ../AST-Merging-Evaluation-Paper/plots/ + git clone $OVERLEAF_GIT_REPO ${{ github.workspace }}/AST-Merging-Evaluation-Paper + + - name: Run make command to copy plots + run: make copy-paper + + - name: Change directory to Overleaf repository + run: cd ${{ github.workspace }}/AST-Merging-Evaluation-Paper - name: Commit and Push to Overleaf run: | - cd ../AST-Merging-Evaluation-Paper git add . git commit -m "Automated plot updates by GitHub CI/CD Bot" - git push - + git push origin master