Skip to content

Commit 4eae62e

Browse files
committed
🔄 Synced local '.github/workflows/' with remote '.github/workflows/'
release-null
1 parent de3884d commit 4eae62e

File tree

4 files changed

+56
-34
lines changed

4 files changed

+56
-34
lines changed

‎.github/workflows/delete-preview.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
# Check out current repository
2020
- name: checkout
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0
2424

‎.github/workflows/pull_request.yml

+14-8
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
20+
token: ${{ secrets.GH_PAT }}
2021

2122
# Use the yaml-env-action action.
2223
- name: Load environment from YAML
@@ -31,15 +32,17 @@ jobs:
3132
# Make the branch fresh
3233
- name: Make the branch fresh
3334
run: |
34-
git config --local user.email "[email protected]"
35-
git config --local user.name "jhudsl-robot"
35+
git config --global --add safe.directory $GITHUB_WORKSPACE
36+
git config --global user.email "[email protected]"
37+
git config --global user.name "jhudsl-robot"
3638
3739
branch_name='preview-${{ github.event.pull_request.number }}'
3840
echo branch doesnt exist
3941
git checkout -b $branch_name || echo branch exists
4042
git push --set-upstream origin $branch_name
4143
shell: bash
4244

45+
4346
outputs:
4447
toggle_spell_check: "${{ env.SPELL_CHECK }}"
4548
toggle_style_code: "${{ env.STYLE_CODE }}"
@@ -58,6 +61,7 @@ jobs:
5861
check_type: spelling
5962
error_min: 3
6063
gh_pat: secrets.GH_PAT
64+
branch_name: ${GITHUB_HEAD_REF}
6165

6266
url-check:
6367
name: Check URLs
@@ -68,6 +72,7 @@ jobs:
6872
check_type: urls
6973
error_min: 0
7074
gh_pat: secrets.GH_PAT
75+
branch_name: ${GITHUB_HEAD_REF}
7176

7277
quiz-check:
7378
name: Check quiz formatting
@@ -78,6 +83,7 @@ jobs:
7883
check_type: quiz_format
7984
error_min: 0
8085
gh_pat: secrets.GH_PAT
86+
branch_name: ${GITHUB_HEAD_REF}
8187

8288
############################# Style the code ###################################
8389
style-code:
@@ -90,7 +96,7 @@ jobs:
9096

9197
steps:
9298
- name: Checkout files
93-
uses: actions/checkout@v3
99+
uses: actions/checkout@v4
94100
with:
95101
fetch-depth: 0
96102

@@ -116,16 +122,16 @@ jobs:
116122

117123
steps:
118124
- name: Checkout files
119-
uses: actions/checkout@v3
125+
uses: actions/checkout@v4
120126
with:
121127
fetch-depth: 0
122128

123129
# Set up git checkout
124130
- name: Set up git checkout
125131
run: |
126-
git config --system --add safe.directory "$GITHUB_WORKSPACE"
127-
git config --local user.email "[email protected]"
128-
git config --local user.name "jhudsl-robot"
132+
git config --global --add safe.directory $GITHUB_WORKSPACE
133+
git config --global user.email "[email protected]"
134+
git config --global user.name "jhudsl-robot"
129135
130136
branch_name='preview-${{ github.event.pull_request.number }}'
131137
git fetch --all

‎.github/workflows/render-all.yml

+39-23
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
paths:
1111
- '**.Rmd'
1212
- assets/*
13+
- quizzes/*
1314

1415
jobs:
1516

@@ -18,7 +19,7 @@ jobs:
1819
runs-on: ubuntu-latest
1920
steps:
2021
- name: Checkout
21-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2223

2324
# Use the yaml-env-action action.
2425
- name: Load environment from YAML
@@ -29,6 +30,7 @@ jobs:
2930
toggle_bookdown: "${{ env.RENDER_BOOKDOWN }}"
3031
toggle_coursera: "${{ env.RENDER_COURSERA }}"
3132
toggle_leanpub: "${{ env.RENDER_LEANPUB }}"
33+
make_book_txt: "${{ env.MAKE_BOOK_TXT }}"
3234
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}"
3335
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"
3436

@@ -42,16 +44,16 @@ jobs:
4244

4345
steps:
4446
- name: checkout
45-
uses: actions/checkout@v3
47+
uses: actions/checkout@v4
4648
with:
4749
fetch-depth: 0
4850
token: ${{ secrets.GH_PAT }}
4951

5052
- name: Login as jhudsl-robot
5153
run: |
52-
git config --system --add safe.directory "$GITHUB_WORKSPACE"
53-
git config --local user.email "[email protected]"
54-
git config --local user.name "jhudsl-robot"
54+
git config --global --add safe.directory $GITHUB_WORKSPACE
55+
git config --global user.email "[email protected]"
56+
git config --global user.name "jhudsl-robot"
5557
5658
# We want a fresh run of the renders each time
5759
- name: Delete old docs/*
@@ -78,10 +80,11 @@ jobs:
7880
GH_PAT: ${{ secrets.GH_PAT }}
7981
run: |
8082
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
83+
git fetch origin
8184
git add --force docs/*
8285
git commit -m 'Render bookdown' || echo "No changes to commit"
8386
git pull --allow-unrelated-histories --strategy-option=ours
84-
git push origin main || echo "No changes to push"
87+
git push -u origin main || echo "No changes to push"
8588
8689
render-tocless:
8790
name: Render TOC-less version for Leanpub or Coursera
@@ -93,15 +96,16 @@ jobs:
9396

9497
steps:
9598
- name: checkout
96-
uses: actions/checkout@v3
99+
uses: actions/checkout@v4
97100
with:
98101
fetch-depth: 0
99102
token: ${{ secrets.GH_PAT }}
100103

101104
- name: Login as jhudsl-robot
102105
run: |
103-
git config --local user.email "[email protected]"
104-
git config --local user.name "jhudsl-robot"
106+
git config --global --add safe.directory $GITHUB_WORKSPACE
107+
git config --global user.email "[email protected]"
108+
git config --global user.name "jhudsl-robot"
105109
106110
# Rendered content for Leanpub and Coursera is very similar.
107111
# This job creates a shared scaffold for both.
@@ -115,10 +119,11 @@ jobs:
115119
GH_PAT: ${{ secrets.GH_PAT }}
116120
run: |
117121
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
122+
git fetch origin
118123
git add --force docs/no_toc*
119124
git commit -m 'Render toc-less' || echo "No changes to commit"
120125
git pull --allow-unrelated-histories --strategy-option=ours
121-
git push origin main || echo "No changes to push"
126+
git push -u origin main || echo "No changes to push"
122127
123128
render-leanpub:
124129
name: Finish Leanpub prep
@@ -130,15 +135,16 @@ jobs:
130135

131136
steps:
132137
- name: checkout
133-
uses: actions/checkout@v3
138+
uses: actions/checkout@v4
134139
with:
135140
fetch-depth: 0
136141
token: ${{ secrets.GH_PAT }}
137142

138143
- name: Login as jhudsl-robot
139144
run: |
140-
git config --local user.email "[email protected]"
141-
git config --local user.name "jhudsl-robot"
145+
git config --global --add safe.directory $GITHUB_WORKSPACE
146+
git config --global user.email "[email protected]"
147+
git config --global user.name "jhudsl-robot"
142148
143149
# Create screenshots
144150
- name: Run the screenshot creation
@@ -153,16 +159,25 @@ jobs:
153159
--output_dir resources/chapt_screen_images)
154160
155161
# We want a fresh run of the renders each time
156-
- name: Delete old manuscript/
157-
run: rm -rf manuscript/
162+
- name: Delete manuscript/
163+
env:
164+
GH_PAT: ${{ secrets.GH_PAT }}
165+
run: |
166+
rm -rf manuscript/
167+
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
168+
git fetch origin
169+
git add .
170+
git commit -m 'Delete manuscript folder' || echo "No changes to commit"
171+
git pull --allow-unrelated-histories --strategy-option=ours
172+
git push -u origin main || echo "No changes to push"
158173
159174
- name: Run ottrpal::bookdown_to_embed_leanpub
160175
if: needs.yaml-check.outputs.toggle_quiz_check == 'no'
161176
run: |
162177
Rscript -e "ottrpal::bookdown_to_embed_leanpub(
163178
render = FALSE, \
164179
chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \
165-
make_book_txt = TRUE, \
180+
make_book_txt = as.logical('${{needs.yaml-check.outputs.make_book_txt}}'), \
166181
quiz_dir = NULL)"
167182
168183
- name: Run ottrpal::bookdown_to_embed_leanpub
@@ -171,21 +186,20 @@ jobs:
171186
Rscript -e "ottrpal::bookdown_to_embed_leanpub(
172187
render = FALSE, \
173188
chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \
174-
make_book_txt = TRUE)"
189+
make_book_txt = as.logical('${{needs.yaml-check.outputs.make_book_txt}}'))"
175190
176191
# Commit the rendered Leanpub files
177192
- name: Commit rendered Leanpub files
178193
env:
179194
GH_PAT: ${{ secrets.GH_PAT }}
180195
run: |
181196
mkdir -p manuscript
182-
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
183197
git add --force manuscript/*
184198
git add --force resources/*
185199
git add --force docs/*
186200
git commit -m 'Render Leanpub' || echo "No changes to commit"
187201
git pull --allow-unrelated-histories --strategy-option=ours
188-
git push origin main || echo "No changes to push"
202+
git push --force --set-upstream origin main || echo "No changes to push"
189203
190204
render-coursera:
191205
name: Finish Coursera prep
@@ -197,15 +211,16 @@ jobs:
197211

198212
steps:
199213
- name: checkout
200-
uses: actions/checkout@v3
214+
uses: actions/checkout@v4
201215
with:
202216
fetch-depth: 0
203217
token: ${{ secrets.GH_PAT }}
204218

205219
- name: Login as jhudsl-robot
206220
run: |
207-
git config --local user.email "[email protected]"
208-
git config --local user.name "jhudsl-robot"
221+
git config --global --add safe.directory $GITHUB_WORKSPACE
222+
git config --global user.email "[email protected]"
223+
git config --global user.name "jhudsl-robot"
209224
210225
# Run Coursera version
211226
- name: Convert Leanpub quizzes to Coursera
@@ -219,9 +234,10 @@ jobs:
219234
GH_PAT: ${{ secrets.GH_PAT }}
220235
run: |
221236
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
237+
git fetch origin
222238
git add --force manuscript/*
223239
git add --force resources/*
224240
git add --force docs/*
225241
git commit -m 'Render Coursera quizzes' || echo "No changes to commit"
226242
git pull --allow-unrelated-histories --strategy-option=ours
227-
git push origin main || echo "No changes to push"
243+
git push -u origin main || echo "No changes to push"

‎.github/workflows/transfer-rendered-files.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525

2626
# Use the yaml-env-action action.
2727
- name: Load environment from YAML
@@ -65,7 +65,7 @@ jobs:
6565
6666
- name: Checkout code from Leanpub repo
6767
if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }}
68-
uses: actions/checkout@v3
68+
uses: actions/checkout@v4
6969
with:
7070
repository: ${{ steps.git_repo_check.outputs.leanpub_repo }}
7171
token: ${{ secrets.GH_PAT }}

0 commit comments

Comments
 (0)