diff --git a/.github/workflows/render-preview.yml b/.github/workflows/render-preview.yml index 9112f8ac..432cb5eb 100644 --- a/.github/workflows/render-preview.yml +++ b/.github/workflows/render-preview.yml @@ -19,9 +19,6 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: checkout uses: actions/checkout@v2 - with: - # get the full repo - fetch-depth: 0 # We want a fresh run of the renders each time - name: Delete old docs/* @@ -62,16 +59,16 @@ jobs: - name: Commit rendered bookdown files to development branch id: commit run: | - git checkout -b "preview-${{ github.event.pull_request.number }}" git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" - changes=$(git diff --name-only origin/main -- docs) - git add -A - git commit -m 'Render bookdown preview' || echo "No changes to commit" - git push --force origin "preview-${{ github.event.pull_request.number }}" || echo "No changes to push" + changes=$(git diff --name-only `git log --format="%H" -n 1 origin/main` -- docs) if [[ -n $changes ]]; then echo ::set-output name=changes::$(echo 'changes') + git checkout -b "preview-${{ github.event.pull_request.number }}" + git add -A + git commit -m 'Render bookdown preview' + git push --force origin "preview-${{ github.event.pull_request.number }}" else echo ::set-output name=changes::$(echo 'no_changes') fi diff --git a/.github/workflows/style-and-sp-check.yml b/.github/workflows/style-and-sp-check.yml index 0250e535..002cbebf 100644 --- a/.github/workflows/style-and-sp-check.yml +++ b/.github/workflows/style-and-sp-check.yml @@ -21,9 +21,6 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - uses: actions/checkout@v2 - # What branch to commit to: the one from the pull request - with: - ref: ${{ github.event.pull_request.head.ref }} - name: Run spell check id: spell_check_run