diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 643ba0f..9666ec4 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,5 +1,5 @@ # Candace Savonen Dec 2021 -# Updated April 2023 +# Updated Aug 2024 name: Pull Request on: @@ -16,6 +16,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ secrets.GH_PAT }} # Use the yaml-env-action action. - name: Load environment from YAML @@ -25,7 +26,7 @@ jobs: # Delete the branch if this has been run before - name: Delete branch locally and remotely - run: git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete" + run: git push --force origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete" # Make the branch fresh - name: Make the branch fresh @@ -37,7 +38,7 @@ jobs: branch_name='preview-${{ github.event.pull_request.number }}' echo branch doesnt exist git checkout -b $branch_name || echo branch exists - git push --set-upstream origin $branch_name + git push --force --set-upstream origin $branch_name shell: bash outputs: @@ -115,12 +116,12 @@ jobs: - name: Website preview for download run: zip website-preview.zip docs/* -r - # Commit the rendered website files - - name: Commit rendered website files to preview branch + # Commit the website files + - name: Commit rendered website files id: commit run: | branch_name='preview-${{ github.event.pull_request.number }}' - git diff origin/main -- '*.html' >/dev/null && changes=true || changes=false + git diff origin/main -- docs >/dev/null && changes=true || changes=false echo "changes=$changes" >> $GITHUB_OUTPUT git add . --force git commit -m 'Render preview' || echo "No changes to commit" diff --git a/.github/workflows/render-site.yml b/.github/workflows/render-site.yml index cf214ec..d5d6415 100644 --- a/.github/workflows/render-site.yml +++ b/.github/workflows/render-site.yml @@ -41,8 +41,8 @@ jobs: runs-on: ubuntu-latest container: image: ${{needs.yaml-check.outputs.rendering_docker_image}} - # Steps represent a sequence of tasks that will be executed as part of the job - steps: + + steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: checkout uses: actions/checkout@v4