Skip to content

Commit 701e314

Browse files
authored
Merge f1ea2ae into 599e962
2 parents 599e962 + f1ea2ae commit 701e314

File tree

4 files changed

+49
-9
lines changed

4 files changed

+49
-9
lines changed

.github/workflows/check-url.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ jobs:
7878
run: |
7979
echo ${{ steps.check-report.outputs.error_url }}
8080
echo ${{ steps.check-report.outputs.error_num }}
81+
82+
# Commit file
83+
- name: Commit tocless bookdown files
84+
if: ${{ steps.check-report.outputs.error_num >= 1 }}
85+
env:
86+
GH_PAT: ${{ secrets.GH_PAT }}
87+
run: |
88+
git add --force check_reports/url_checks.tsv
89+
git commit -m 'Add spell check file' || echo "No changes to commit"
90+
git push --set-upstream origin preview-spell-error || echo echo branch exists remotely
8191
8292
- name: Find issues
8393
id: find-issue

.github/workflows/pull_request.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
20-
token: ${{ secrets.GH_PAT }}
2120

2221
# Use the yaml-env-action action.
2322
- name: Load environment from YAML
@@ -49,6 +48,8 @@ jobs:
4948
toggle_style_code: "${{ env.STYLE_CODE }}"
5049
toggle_url_check: "${{ env.URL_CHECKER }}"
5150
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"
51+
toggle_md_linter: "${{ env.MARKDOWN_LINTER }}"
52+
toggle_readability: "${{ env.READABILITY_REPORT }}"
5253
toggle_render_preview: "${{ env.RENDER_PREVIEW }}"
5354
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}"
5455

@@ -61,8 +62,9 @@ jobs:
6162
with:
6263
check_type: spelling
6364
error_min: 3
64-
gh_pat: secrets.GH_PAT
6565
branch_name: ${GITHUB_HEAD_REF}
66+
secrets:
67+
gh_pat: ${{ secrets.GH_PAT }}
6668

6769
url-check:
6870
name: Check URLs
@@ -72,8 +74,9 @@ jobs:
7274
with:
7375
check_type: urls
7476
error_min: 0
75-
gh_pat: secrets.GH_PAT
7677
branch_name: ${GITHUB_HEAD_REF}
78+
secrets:
79+
gh_pat: ${{ secrets.GH_PAT }}
7780

7881
quiz-check:
7982
name: Check quiz formatting
@@ -83,8 +86,9 @@ jobs:
8386
with:
8487
check_type: quiz_format
8588
error_min: 0
86-
gh_pat: secrets.GH_PAT
8789
branch_name: ${GITHUB_HEAD_REF}
90+
secrets:
91+
gh_pat: ${{ secrets.GH_PAT }}
8892

8993
############################# Style the code ###################################
9094
style-code:
@@ -111,6 +115,26 @@ jobs:
111115
git commit -m 'Style *mds' || echo "No changes to commit"
112116
git push origin || echo "No changes to commit"
113117
118+
############################# Readability Report ###################################
119+
120+
readability-report:
121+
name: Readability report
122+
needs: yaml-check
123+
runs-on: ubuntu-latest
124+
if: ${{needs.yaml-check.outputs.toggle_readability == 'yes'}}
125+
126+
steps:
127+
- name: Checkout repo
128+
uses: actions/checkout@v4
129+
with:
130+
fetch-depth: 0
131+
132+
- name: Readability report
133+
uses: Rebilly/lexi@v2
134+
with:
135+
github-token: ${{ secrets.GH_PAT }}
136+
glob: '**/*.md'
137+
114138
############################# Render Preview ###################################
115139

116140
render-preview:

.github/workflows/render-all.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88
push:
99
branches: [ main, staging ]
1010
paths:
11-
- '**md$'
11+
- '*.qmd'
12+
- '*.Rmd'
1213
- assets/*
1314
- quizzes/*
1415

@@ -101,7 +102,7 @@ jobs:
101102
git add --force docs/*
102103
git commit -m 'Render course' || echo "No changes to commit"
103104
git status docs/*
104-
git push -u origin main || echo "No changes to push"
105+
git push --force -u origin main || echo "No changes to push"
105106
106107
render-tocless:
107108
name: Render TOC-less version for Leanpub or Coursera
@@ -149,7 +150,7 @@ jobs:
149150
git add --force docs/no_toc*
150151
git commit -m 'Render toc-less' || echo "No changes to commit"
151152
git status docs/no_toc*
152-
git push -u origin main || echo "No changes to push"
153+
git push --force -u origin main || echo "No changes to push"
153154
154155
render-leanpub:
155156
name: Finish Leanpub prep
@@ -188,6 +189,7 @@ jobs:
188189
--git_pat ${{ secrets.GH_PAT }} \
189190
--repo $GITHUB_REPOSITORY \
190191
--output_dir resources/chapt_screen_images)
192+
rm make_screenshots.R
191193
192194
# We want a fresh run of the renders each time
193195
- name: Delete manuscript/
@@ -276,4 +278,4 @@ jobs:
276278
git add --force docs/*
277279
git commit -m 'Render Coursera quizzes' || echo "No changes to commit"
278280
git status
279-
git push -u origin main || echo "No changes to push"
281+
git push --force -u origin main || echo "No changes to push"

config_automation.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ render-preview: yes
1010
spell-check: yes
1111
# Style any R code
1212
style-code: yes
13+
# Would you like your markdown files to be checked for formatting
14+
markdown-linter: yes
15+
# Would you like a readability report on your markdowns?
16+
readability-report: yes
1317
# Test build the docker image if any docker-relevant files have been changed
1418
docker-test: no
1519
# Should URLs be tested periodically?
@@ -27,4 +31,4 @@ make-book-txt: yes
2731

2832
# What docker image should be used for rendering?
2933
# The default is jhudsl/base_ottr:main
30-
rendering-docker-image: 'jhudsl/ottr_python:main'
34+
rendering-docker-image: 'jhudsl/base_ottr:main'

0 commit comments

Comments
 (0)