From 623fed7abf68dfcf8c060042507c66b4d15b6331 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 26 Jan 2022 16:55:34 -0500 Subject: [PATCH] Set to bash intentionally (#419) * set to bash * Update * no workflow dispatch --- .github/workflows/render-preview.yml | 11 ++++++----- .github/workflows/style-and-sp-check.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/render-preview.yml b/.github/workflows/render-preview.yml index bd89778e..12a70fc6 100644 --- a/.github/workflows/render-preview.yml +++ b/.github/workflows/render-preview.yml @@ -31,17 +31,18 @@ jobs: branch_name='preview-${{ github.event.pull_request.number }}' exists=$(git ls-remote https://${{ secrets.GH_PAT }}@github.com/$GITHUB_REPOSITORY $branch_name | wc -l | xargs) - if [[ $exists -gt 0 ]];then - echo branch does exist - git checkout $branch_name - git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }} - else + if [[ $exists == 0 ]];then echo branch doesnt exist git checkout -b $branch_name git push --set-upstream origin $branch_name + else + echo branch does exist + git checkout $branch_name + git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }} fi rm -r docs/* + shell: bash # Run bookdown rendering - name: Run bookdown render diff --git a/.github/workflows/style-and-sp-check.yml b/.github/workflows/style-and-sp-check.yml index f455b6d5..4deb0c2f 100644 --- a/.github/workflows/style-and-sp-check.yml +++ b/.github/workflows/style-and-sp-check.yml @@ -5,7 +5,6 @@ name: Style and spell check R markdowns # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the main branch on: - workflow_dispatch: pull_request: branches: [ main ] @@ -30,15 +29,16 @@ jobs: branch_name='preview-${{ github.event.pull_request.number }}' exists=$(git ls-remote https://${{ secrets.GH_PAT }}@github.com/$GITHUB_REPOSITORY $branch_name | wc -l | xargs) - if [[ $exists -gt 0 ]];then - echo branch does exist - git checkout $branch_name - git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }} - else + if [[ $exists == 0 ]];then echo branch doesnt exist git checkout -b $branch_name git push --set-upstream origin $branch_name + else + echo branch does exist + git checkout $branch_name + git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }} fi + shell: bash - name: Run spell check id: spell_check_run