GHA: Automated transfer of ottrpal-needed files from Bookdown repository #42
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
# Candace Savonen Dec 2021 | |
name: Pull Request | |
on: | |
pull_request: | |
branches: [ main, staging ] | |
jobs: | |
yaml-check: | |
name: Load user automation choices | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
# Use the yaml-env-action action. | |
- name: Load environment from YAML | |
uses: doughepi/[email protected] | |
with: | |
files: config_automation.yml # Pass a space-separated list of configuration files. Rightmost files take precedence. | |
# 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" | |
# Make the branch fresh | |
- name: Make the branch fresh | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "jhudsl-robot" | |
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 | |
shell: bash | |
outputs: | |
toggle_spell_check: "${{ env.SPELL_CHECK }}" | |
toggle_url_check: "${{ env.URL_CHECKER }}" | |
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}" | |
########################## Make the error reports ############################## | |
spell-check: | |
name: Check spelling | |
needs: yaml-check | |
if: ${{needs.yaml-check.outputs.toggle_spell_check == 'yes'}} | |
uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main | |
with: | |
check_type: spelling | |
error_min: 3 | |
gh_pat: secrets.GH_PAT | |
url-check: | |
name: Check URLs | |
needs: yaml-check | |
if: ${{needs.yaml-check.outputs.toggle_url_check == 'yes'}} | |
uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main | |
with: | |
check_type: urls | |
error_min: 0 | |
gh_pat: secrets.GH_PAT | |
quiz-check: | |
name: Check quiz formatting | |
if: ${{needs.yaml-check.outputs.toggle_quiz_check == 'yes'}} | |
needs: yaml-check | |
uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main | |
with: | |
check_type: quiz_format | |
error_min: 0 | |
gh_pat: secrets.GH_PAT |