Skip to content

Commit

Permalink
Fixing GHA (#376)
Browse files Browse the repository at this point in the history
* fix checkout step?

* Only push things if there's changes

* Have to checkout branch first

* try main instead?

* Try this

* Let's try being more exact about what commit
  • Loading branch information
cansavvy authored Jan 11, 2022
1 parent 8ca2ad4 commit 15230a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/render-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/style-and-sp-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 15230a3

Please sign in to comment.