-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to adjust for if its a forked PR (#394)
- Loading branch information
Showing
2 changed files
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,11 @@ jobs: | |
rm -r docs/* | ||
# Add remote if this is a fork | ||
- name: Commit rendered bookdown files to preview branch | ||
if: github.event.repository.name == 'OTTR_Template' | ||
run: git remote add jhudsl [email protected]:jhudsl/OTTR_Template.git | ||
|
||
# Run bookdown rendering | ||
- name: Run bookdown render | ||
id: bookdown | ||
|
@@ -71,8 +76,9 @@ jobs: | |
echo Coursera status ${{steps.coursera.outcome}} | ||
exit 1 | ||
# Commit the rendered bookdown files | ||
- name: Commit rendered bookdown files to preview branch | ||
# Commit the rendered bookdown files if this isn't to the OTTR Template | ||
- name: Commit rendered bookdown | ||
if: github.event.repository.name != 'OTTR_Template' | ||
id: commit | ||
run: | | ||
changes=$(git diff --name-only `git log --format="%H" -n 1 origin/main` -- docs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ on: | |
pull_request: | ||
branches: [ main ] | ||
|
||
permissions: write-all | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "style and check" | ||
|
@@ -47,6 +49,8 @@ jobs: | |
branch_name='preview-${{ github.event.pull_request.number }}' | ||
git rev-parse --quiet --verify $branch_name >/dev/null && exists=true || exists=false | ||
git remote add jhudsl [email protected]:jhudsl/OTTR_Template.git | ||
if [[ $exists == true ]]; | ||
then | ||
git checkout $branch_name | ||
|