From 6e6965ea3ee737ff1363ca652d0f551a0f47353e Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 16 Feb 2022 13:20:02 -0500 Subject: [PATCH 01/25] Add docker image as option --- .github/workflows/pull_request.yml | 3 ++- .github/workflows/render-all.yml | 9 +++++---- config_automation.yml | 4 ++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 5a980b03..f4a89763 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -54,6 +54,7 @@ jobs: toggle_quiz_check: "${{ env.CHECK_QUIZZES }}" toggle_render_preview: "${{ env.RENDER_PREVIEW }}" toggle_docker_build: "${{ env.DOCKER_BUILD }}" + rendering-docker-image: "${{ env.RENDERING_DOCKER_IMAGE }}" dockerfiles_changed: steps.verify-changed-files.outputs.files_changed spell-check: @@ -307,7 +308,7 @@ jobs: needs: yaml-check runs-on: ubuntu-latest container: - image: jhudsl/course_template:main + image: needs.yaml-check.outputs.rendering_docker_image if: ${{needs.yaml-check.outputs.toggle_render_preview == 'yes'}} steps: - name: Checkout files diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 2eb7f894..99ffad0f 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -29,13 +29,14 @@ jobs: toggle_bookdown: "${{ env.RENDER_BOOKDOWN }}" toggle_coursera: "${{ env.RENDER_COURSERA }}" toggle_leanpub: "${{ env.RENDER_LEANPUB }}" - + rendering-docker-image: "${{ env.RENDERING_DOCKER_IMAGE }}" + render-bookdown: name: Render bookdown needs: yaml-check runs-on: ubuntu-latest container: - image: jhudsl/course_template:main + image: needs.yaml-check.outputs.rendering_docker_image if: ${{needs.yaml-check.outputs.toggle_bookdown == 'yes'}} steps: @@ -83,7 +84,7 @@ jobs: needs: [yaml-check] runs-on: ubuntu-latest container: - image: jhudsl/course_template:main + image: needs.yaml-check.outputs.rendering_docker_image if: ${{needs.yaml-check.outputs.toggle_coursera == 'yes' || needs.yaml-check.outputs.toggle_leanpub == 'yes'}} steps: @@ -165,7 +166,7 @@ jobs: needs: [yaml-check, render-tocless] runs-on: ubuntu-latest container: - image: jhudsl/course_template:main + image: needs.yaml-check.outputs.rendering_docker_image if: ${{needs.yaml-check.outputs.toggle_coursera == 'yes'}} steps: diff --git a/config_automation.yml b/config_automation.yml index 5a9d173e..9fe6efb3 100644 --- a/config_automation.yml +++ b/config_automation.yml @@ -18,3 +18,7 @@ docker-test: no render-bookdown: yes render-leanpub: no render-coursera: no + +# What docker image should be used for rendering? +# The default is jhudsl/course_template:main +rendering-docker-image: jhudsl/course_template:main From a5eed0116fefefa100839da590e24e84fc748916 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 16 Feb 2022 13:30:30 -0500 Subject: [PATCH 02/25] Add a "no quizzes" option --- .github/workflows/render-all.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 99ffad0f..44efb4bb 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -30,7 +30,8 @@ jobs: toggle_coursera: "${{ env.RENDER_COURSERA }}" toggle_leanpub: "${{ env.RENDER_LEANPUB }}" rendering-docker-image: "${{ env.RENDERING_DOCKER_IMAGE }}" - + toggle_quiz_check: "${{ env.CHECK_QUIZZES }}" + render-bookdown: name: Render bookdown needs: yaml-check @@ -146,6 +147,16 @@ jobs: run: rm -rf manuscript/ - name: Run ottrpal::bookdown_to_embed_leanpub + if: needs.yaml-check.outputs.toggle_quiz_check == 'no' + run: | + Rscript -e "ottrpal::bookdown_to_embed_leanpub( + render = FALSE, \ + chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \ + make_book_txt = TRUE, \ + quiz_dir = null)" + + - name: Run ottrpal::bookdown_to_embed_leanpub + if: needs.yaml-check.outputs.toggle_quiz_check == 'yes' run: | Rscript -e "ottrpal::bookdown_to_embed_leanpub( render = FALSE, \ @@ -183,7 +194,7 @@ jobs: # Run Coursera version - name: Convert Leanpub quizzes to Coursera - if: needs.yaml-check.outputs.toggle_leanpub == 'yes' + if: needs.yaml-check.outputs.toggle_leanpub == 'yes' && needs.yaml-check.outputs.toggle_quiz_check == 'yes' id: coursera run: Rscript -e "ottrpal::convert_coursera_quizzes()" From d203fd75355d12d2c9c2a97529fcf59811667d81 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 16 Feb 2022 13:32:22 -0500 Subject: [PATCH 03/25] Add some ${{ }} --- .github/workflows/render-all.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 99ffad0f..5da8f245 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -36,7 +36,7 @@ jobs: needs: yaml-check runs-on: ubuntu-latest container: - image: needs.yaml-check.outputs.rendering_docker_image + image: ${{needs.yaml-check.outputs.rendering_docker_image}} if: ${{needs.yaml-check.outputs.toggle_bookdown == 'yes'}} steps: @@ -84,7 +84,7 @@ jobs: needs: [yaml-check] runs-on: ubuntu-latest container: - image: needs.yaml-check.outputs.rendering_docker_image + image: ${{needs.yaml-check.outputs.rendering_docker_image}} if: ${{needs.yaml-check.outputs.toggle_coursera == 'yes' || needs.yaml-check.outputs.toggle_leanpub == 'yes'}} steps: @@ -166,7 +166,7 @@ jobs: needs: [yaml-check, render-tocless] runs-on: ubuntu-latest container: - image: needs.yaml-check.outputs.rendering_docker_image + image: ${{needs.yaml-check.outputs.rendering_docker_image}} if: ${{needs.yaml-check.outputs.toggle_coursera == 'yes'}} steps: From d4833072d517d2bf8efe851ffff3e624fc5ad4fc Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 16 Feb 2022 13:34:20 -0500 Subject: [PATCH 04/25] Missed one --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index f4a89763..923ba264 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -308,7 +308,7 @@ jobs: needs: yaml-check runs-on: ubuntu-latest container: - image: needs.yaml-check.outputs.rendering_docker_image + image: ${{needs.yaml-check.outputs.rendering_docker_image}} if: ${{needs.yaml-check.outputs.toggle_render_preview == 'yes'}} steps: - name: Checkout files From 2bc17d57c931e055d7650fcbca53c5181544c117 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 16 Feb 2022 13:38:55 -0500 Subject: [PATCH 05/25] Fix typo --- .github/workflows/pull_request.yml | 3 ++- .github/workflows/render-all.yml | 5 +++-- config_automation.yml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 923ba264..ddf0e37d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -54,7 +54,7 @@ jobs: toggle_quiz_check: "${{ env.CHECK_QUIZZES }}" toggle_render_preview: "${{ env.RENDER_PREVIEW }}" toggle_docker_build: "${{ env.DOCKER_BUILD }}" - rendering-docker-image: "${{ env.RENDERING_DOCKER_IMAGE }}" + rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}" dockerfiles_changed: steps.verify-changed-files.outputs.files_changed spell-check: @@ -310,6 +310,7 @@ jobs: container: image: ${{needs.yaml-check.outputs.rendering_docker_image}} if: ${{needs.yaml-check.outputs.toggle_render_preview == 'yes'}} + steps: - name: Checkout files uses: actions/checkout@v2 diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 5da8f245..772391b4 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -29,8 +29,8 @@ jobs: toggle_bookdown: "${{ env.RENDER_BOOKDOWN }}" toggle_coursera: "${{ env.RENDER_COURSERA }}" toggle_leanpub: "${{ env.RENDER_LEANPUB }}" - rendering-docker-image: "${{ env.RENDERING_DOCKER_IMAGE }}" - + rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}" + render-bookdown: name: Render bookdown needs: yaml-check @@ -48,6 +48,7 @@ jobs: - name: Login as jhudsl-robot run: | + git config --local user.email "itcrtrainingnetwork@gmail.com" git config --local user.name "jhudsl-robot" diff --git a/config_automation.yml b/config_automation.yml index 9fe6efb3..b907b9b0 100644 --- a/config_automation.yml +++ b/config_automation.yml @@ -21,4 +21,4 @@ render-coursera: no # What docker image should be used for rendering? # The default is jhudsl/course_template:main -rendering-docker-image: jhudsl/course_template:main +rendering-docker-image: 'jhudsl/course_template:main' From 025ac9d0a15d3e164dd6f62ea5f17d2814f408e6 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 17 Feb 2022 07:54:06 -0500 Subject: [PATCH 06/25] Test no quiz render --- config_automation.yml | 4 +- coursera_quizzes/quiz_ch1.md.yml | 69 -------------------------------- quizzes/quiz_ch1.md | 54 ------------------------- 3 files changed, 2 insertions(+), 125 deletions(-) delete mode 100644 coursera_quizzes/quiz_ch1.md.yml delete mode 100644 quizzes/quiz_ch1.md diff --git a/config_automation.yml b/config_automation.yml index b907b9b0..1660ecd4 100644 --- a/config_automation.yml +++ b/config_automation.yml @@ -16,8 +16,8 @@ docker-test: no ##### Renderings run upon merge to main branch ##### # Rendering each platform's content render-bookdown: yes -render-leanpub: no -render-coursera: no +render-leanpub: yes +render-coursera: yes # What docker image should be used for rendering? # The default is jhudsl/course_template:main diff --git a/coursera_quizzes/quiz_ch1.md.yml b/coursera_quizzes/quiz_ch1.md.yml deleted file mode 100644 index b32ce87d..00000000 --- a/coursera_quizzes/quiz_ch1.md.yml +++ /dev/null @@ -1,69 +0,0 @@ - -- typeName: multipleChoice - prompt: First question to ask goes here. (Note- you need a question mark at end like this. Just one is required if using a question mark in your question field)? - - shuffleOptions: true - options: - - answer: One correct answer here marked with a "C" - isCorrect: true - - answer: Mandatory incorrect answers have an "m" - isCorrect: false - - answer: A second mandatory incorrect answer - isCorrect: false - - answer: An optional incorrect answer here marked with an "o" - isCorrect: false - - answer: A second optional incorrect answer here - isCorrect: false - -- typeName: multipleChoice - prompt: Question example with just a question mark? - - shuffleOptions: true - options: - - answer: One correct answer here marked with a "C" - isCorrect: true - - answer: Mandatory incorrect answers have an "m" - isCorrect: false - - answer: A second mandatory incorrect answer - isCorrect: false - - answer: An optional incorrect answer here marked with an "o" - isCorrect: false - - answer: A second optional incorrect answer here - isCorrect: false - -- typeName: multipleChoice - prompt: Second question to ask goes here? - - shuffleOptions: true - options: - - answer: One correct answer here marked with a "C" - isCorrect: true - - answer: Mandatory incorrect answers have an "m" - isCorrect: false - - answer: A second mandatory incorrect answer - isCorrect: false - - answer: An optional incorrect answer here marked with an "o" - isCorrect: false - - answer: A second optional incorrect answer here - isCorrect: false - -- typeName: multipleChoice - prompt: A more complicated example. Note the question mark at the end of the options! Which of the following are correct - 1. An option described - 2. A second option - 3. A third option - 4. A fourth option - 5. A fifth option ? - - shuffleOptions: true - options: - - answer: All of the examples listed except 5 - isCorrect: true - - answer: 1, 3, and 5 - isCorrect: false - - answer: 1, 2, and 3 - isCorrect: false - - answer: All of the examples except 1 and 5 - isCorrect: false - - answer: All of the examples listed - isCorrect: false diff --git a/quizzes/quiz_ch1.md b/quizzes/quiz_ch1.md deleted file mode 100644 index 26b44552..00000000 --- a/quizzes/quiz_ch1.md +++ /dev/null @@ -1,54 +0,0 @@ - -{quiz, id: quiz_name_here, attempts: 10} - -## Template quiz - -Put any other instructions your quiz takers need to know here like: Choose the best answer. - -{choose-answers: 4} -? First question to ask goes here. (Note- you need a question mark at end like this. Just one is required if using a question mark in your question field)? - -C) One correct answer here marked with a "C" -C) A second correct answer here -m) Mandatory incorrect answers have an "m" -m) A second mandatory incorrect answer -o) An optional incorrect answer here marked with an "o" -o) A second optional incorrect answer here - -{choose-answers: 4} -? Question example with just a question mark? - -C) One correct answer here marked with a "C" -C) A second correct answer here -m) Mandatory incorrect answers have an "m" -m) A second mandatory incorrect answer -o) An optional incorrect answer here marked with an "o" -o) A second optional incorrect answer here - -{choose-answers: 4} -? Second question to ask goes here? - -C) One correct answer here marked with a "C" -C) A second correct answer here -m) Mandatory incorrect answers have an "m" -m) A second mandatory incorrect answer -o) An optional incorrect answer here marked with an "o" -o) A second optional incorrect answer here - - -{choose-answers: 4} -? A more complicated example. Note the question mark at the end of the options! Which of the following are correct -1. An option described -2. A second option -3. A third option -4. A fourth option -5. A fifth option ? - -C) All of the examples listed except 5 -C) All of the listed examples except 5 -m) 1, 3, and 5 -m) 1, 2, and 3 -o) All of the examples except 1 and 5 -o) All of the examples listed - -{/quiz} From 3a50880181e842ab8858c884792f65ed8ab2298e Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 17 Feb 2022 09:23:39 -0500 Subject: [PATCH 07/25] Skip quiz_dir --- .github/workflows/render-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 95add55d..a31fb267 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -154,7 +154,7 @@ jobs: render = FALSE, \ chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \ make_book_txt = TRUE, \ - quiz_dir = null)" + quiz_dir = NULL)" - name: Run ottrpal::bookdown_to_embed_leanpub if: needs.yaml-check.outputs.toggle_quiz_check == 'yes' From 53816730b24240d8f4d5fa6e43027d9616b85808 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 17 Feb 2022 15:02:07 -0500 Subject: [PATCH 08/25] Update Leanpub/Coursera handling --- .github/workflows/render-all.yml | 2 +- .github/workflows/transfer-rendered-files.yml | 1 + scripts/make_screenshots.R | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index a31fb267..f219e23b 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -204,6 +204,6 @@ jobs: run: | git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" - git add --force docs/coursera/* + git add --force docs/no_toc/* git commit -m 'Render Coursera quizzes' || echo "No changes to commit" git push origin main || echo "No changes to push" diff --git a/.github/workflows/transfer-rendered-files.yml b/.github/workflows/transfer-rendered-files.yml index f4e3e742..783c46a9 100644 --- a/.github/workflows/transfer-rendered-files.yml +++ b/.github/workflows/transfer-rendered-files.yml @@ -17,6 +17,7 @@ on: jobs: file-bookdown-pr: runs-on: ubuntu-latest + if: ${{needs.yaml-check.outputs.toggle_coursera == 'yes' || needs.yaml-check.outputs.toggle_leanpub == 'yes' }} steps: - name: Run git repo check diff --git a/scripts/make_screenshots.R b/scripts/make_screenshots.R index 6180ec64..317009f3 100644 --- a/scripts/make_screenshots.R +++ b/scripts/make_screenshots.R @@ -54,7 +54,7 @@ if (is.null(opt$base_url)) { base_url <- cow::get_pages_url(repo_name = opt$repo, git_pat = opt$git_pat) } -chapt_df <- ottrpal::get_chapters(base_url = file.path(base_url, "no_toc")) +chapt_df <- ottrpal::get_chapters(base_url = file.path(base_url, "no_toc/")) file_names <- lapply(chapt_df$url, function(url) { file_name <- gsub(".html", ".png", file.path(output_folder, basename(url))) From de548dfb25165344d5af76bb42ae98c6eff870d2 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 17 Feb 2022 15:06:44 -0500 Subject: [PATCH 09/25] Fix file path --- .github/workflows/transfer-rendered-files.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/transfer-rendered-files.yml b/.github/workflows/transfer-rendered-files.yml index 783c46a9..130281e2 100644 --- a/.github/workflows/transfer-rendered-files.yml +++ b/.github/workflows/transfer-rendered-files.yml @@ -56,7 +56,7 @@ jobs: GH_PAT: ${{ secrets.GH_PAT }} run: | # Copy over images folder - svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/resources/chapt_screen_images resources/chapt_screen_images + svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/manuscript/resources/chapt_screen_images resources/chapt_screen_images - name: Create PR with resources files if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }} @@ -74,7 +74,7 @@ jobs: This PR was initiated by transfer-rendered.yml in the Bookdown repository. It copies over the ottrpal-needed folder (for the `bookdown_to_embed_leanpub(render = FALSE)` function to run properly. - - resources/chapt_screen_images/* + - manuscript/resources/chapt_screen_images/* labels: | automated reviewers: $GITHUB_ACTOR From 781f37bd72f9e267e464a0858cee4d1ca35c9d23 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 07:47:06 -0500 Subject: [PATCH 10/25] Polish up screenshot making --- .github/workflows/render-all.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index f219e23b..32f69230 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -139,6 +139,10 @@ jobs: # Create screenshots - name: Run the screenshot creation run: | + # Remove old folder + rm -rf resources/chapt_screen_images + + # Make new screenshots chapt_urls=$(Rscript --vanilla scripts/make_screenshots.R \ --git_pat ${{ secrets.GH_PAT }} \ --repo $GITHUB_REPOSITORY) @@ -167,8 +171,6 @@ jobs: # Commit the rendered leanpub files - name: Commit rendered leanpub files run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" git add --force manuscript/* git commit -m 'Render Leanpub' || echo "No changes to commit" git push --force origin main || echo "No changes to push" @@ -202,8 +204,6 @@ jobs: # Commit the rendered bookdown files - name: Commit rendered Coursera files run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" git add --force docs/no_toc/* git commit -m 'Render Coursera quizzes' || echo "No changes to commit" git push origin main || echo "No changes to push" From ea273ba6c0eed9f981b8e5859c5580615d24019e Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 07:48:40 -0500 Subject: [PATCH 11/25] Make it not a force push --- .github/workflows/render-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 32f69230..9f0ff6f0 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -173,7 +173,7 @@ jobs: run: | git add --force manuscript/* git commit -m 'Render Leanpub' || echo "No changes to commit" - git push --force origin main || echo "No changes to push" + git push origin main || echo "No changes to push" render-coursera: name: Finish Coursera prep From a4174f0fe19bf9f9766601217fd2ecaea71d7ff8 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 07:51:50 -0500 Subject: [PATCH 12/25] Update file path --- .github/workflows/transfer-rendered-files.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/transfer-rendered-files.yml b/.github/workflows/transfer-rendered-files.yml index 130281e2..1c2713ab 100644 --- a/.github/workflows/transfer-rendered-files.yml +++ b/.github/workflows/transfer-rendered-files.yml @@ -56,7 +56,7 @@ jobs: GH_PAT: ${{ secrets.GH_PAT }} run: | # Copy over images folder - svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/manuscript/resources/chapt_screen_images resources/chapt_screen_images + svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/manuscript/resources/chapt_screen_images manuscript/resources/chapt_screen_images - name: Create PR with resources files if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }} From 4628456f1ad03d94e424e287e7bea5cbeb268086 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 08:08:16 -0500 Subject: [PATCH 13/25] git set-remote with PAT --- .github/workflows/pull_request.yml | 6 +++--- .github/workflows/render-all.yml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ddf0e37d..3eb5ba10 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -100,7 +100,7 @@ jobs: branch_name='preview-${{ github.event.pull_request.number }}' git add --force resources/spell_check_results.tsv git commit -m 'Add spell check file' || echo "No changes to commit" - git pull --set-upstream origin $branch_name --allow-unrelated-histories + git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=theirs git push --force origin $branch_name || echo "No changes to commit" - name: Build components of the spell check comment @@ -251,7 +251,7 @@ jobs: if $changes == true; then git add --force question_error_report.tsv git diff-index --quiet HEAD || git commit -m 'Add question error report file' - git pull --set-upstream origin $branch_name --allow-unrelated-histories + git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=theirs git push origin $branch_name fi fi @@ -359,7 +359,7 @@ jobs: echo ::set-output name=changes::$changes git add . --force git commit -m 'Render preview' || echo "No changes to commit" - git pull --set-upstream origin $branch_name --allow-unrelated-histories + git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=theirs git push --force || echo "No changes to commit" shell: bash diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 9f0ff6f0..81823bbd 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -75,8 +75,7 @@ jobs: # Commit the rendered bookdown files - name: Commit rendered bookdown files run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" + git remote set-url origin https://${secrets.GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/* git commit -m 'Render bookdown' || echo "No changes to commit" git push origin main || echo "No changes to push" @@ -110,8 +109,7 @@ jobs: # Commit the TOC-less version files - name: Commit tocless bookdown files run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" + git remote set-url origin https://${secrets.GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/no_toc* git commit -m 'Render toc-less' || echo "No changes to commit" git push origin main || echo "No changes to push" @@ -171,6 +169,7 @@ jobs: # Commit the rendered leanpub files - name: Commit rendered leanpub files run: | + git remote set-url origin https://${secrets.GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force manuscript/* git commit -m 'Render Leanpub' || echo "No changes to commit" git push origin main || echo "No changes to push" @@ -204,6 +203,7 @@ jobs: # Commit the rendered bookdown files - name: Commit rendered Coursera files run: | + git remote set-url origin https://${secrets.GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/no_toc/* git commit -m 'Render Coursera quizzes' || echo "No changes to commit" git push origin main || echo "No changes to push" From dd1de98c665dc1ffd0b07f49827f5a34945f474d Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 08:33:51 -0500 Subject: [PATCH 14/25] Add git set remote --- .github/sync.yml | 2 -- .github/workflows/render-all.yml | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/sync.yml b/.github/sync.yml index ab7d2b00..3839f7e7 100755 --- a/.github/sync.yml +++ b/.github/sync.yml @@ -3,8 +3,6 @@ group: - files: - - source: config_automation.yml - dest: config_automation.yml - source: .github/workflows/ dest: .github/workflows/ deleteOrphaned: true diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 81823bbd..7328e248 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -74,8 +74,10 @@ jobs: # Commit the rendered bookdown files - name: Commit rendered bookdown files + env: + GH_PAT: ${{ secrets.GH_PAT }} run: | - git remote set-url origin https://${secrets.GH_PAT}@github.com/${GITHUB_REPOSITORY} + git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/* git commit -m 'Render bookdown' || echo "No changes to commit" git push origin main || echo "No changes to push" @@ -108,8 +110,10 @@ jobs: # Commit the TOC-less version files - name: Commit tocless bookdown files + env: + GH_PAT: ${{ secrets.GH_PAT }} run: | - git remote set-url origin https://${secrets.GH_PAT}@github.com/${GITHUB_REPOSITORY} + git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/no_toc* git commit -m 'Render toc-less' || echo "No changes to commit" git push origin main || echo "No changes to push" @@ -168,8 +172,10 @@ jobs: # Commit the rendered leanpub files - name: Commit rendered leanpub files + env: + GH_PAT: ${{ secrets.GH_PAT }} run: | - git remote set-url origin https://${secrets.GH_PAT}@github.com/${GITHUB_REPOSITORY} + git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force manuscript/* git commit -m 'Render Leanpub' || echo "No changes to commit" git push origin main || echo "No changes to push" @@ -202,8 +208,10 @@ jobs: # Commit the rendered bookdown files - name: Commit rendered Coursera files + env: + GH_PAT: ${{ secrets.GH_PAT }} run: | - git remote set-url origin https://${secrets.GH_PAT}@github.com/${GITHUB_REPOSITORY} + git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/no_toc/* git commit -m 'Render Coursera quizzes' || echo "No changes to commit" git push origin main || echo "No changes to push" From b8a78e7eddf7a2045626caab65970adb2db41800 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 08:50:43 -0500 Subject: [PATCH 15/25] git pull settings --- .github/workflows/render-all.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 7328e248..742d32c1 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -80,6 +80,7 @@ jobs: git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/* git commit -m 'Render bookdown' || echo "No changes to commit" + git pull --allow-unrelated-histories --strategy-option=theirs git push origin main || echo "No changes to push" render-tocless: @@ -116,6 +117,7 @@ jobs: git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/no_toc* git commit -m 'Render toc-less' || echo "No changes to commit" + git pull --allow-unrelated-histories --strategy-option=theirs git push origin main || echo "No changes to push" render-leanpub: @@ -178,6 +180,7 @@ jobs: git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force manuscript/* git commit -m 'Render Leanpub' || echo "No changes to commit" + git pull --allow-unrelated-histories --strategy-option=theirs git push origin main || echo "No changes to push" render-coursera: @@ -214,4 +217,5 @@ jobs: git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/no_toc/* git commit -m 'Render Coursera quizzes' || echo "No changes to commit" + git pull --allow-unrelated-histories --strategy-option=theirs git push origin main || echo "No changes to push" From 2f4d8186f17464c5dd0b39d26c6e656883e86db3 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 08:58:53 -0500 Subject: [PATCH 16/25] git add all for coursera --- .github/workflows/render-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 742d32c1..1457301c 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -215,7 +215,7 @@ jobs: GH_PAT: ${{ secrets.GH_PAT }} run: | git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} - git add --force docs/no_toc/* + git add --force . git commit -m 'Render Coursera quizzes' || echo "No changes to commit" git pull --allow-unrelated-histories --strategy-option=theirs git push origin main || echo "No changes to push" From b917cb2221dd1c4c233c9832509d4e9e0397e9d6 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 09:06:31 -0500 Subject: [PATCH 17/25] Update trigger for transfer --- .github/workflows/transfer-rendered-files.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/transfer-rendered-files.yml b/.github/workflows/transfer-rendered-files.yml index 2dcb8831..d184e4c5 100644 --- a/.github/workflows/transfer-rendered-files.yml +++ b/.github/workflows/transfer-rendered-files.yml @@ -33,8 +33,9 @@ jobs: toggle_leanpub: "${{ env.RENDER_LEANPUB }}" - file-bookdown-pr: - runs-on: ubuntu-latest + file-quizzes-pr: + name: File _Quizzes Transfer PR + needs: [yaml-check] if: ${{needs.yaml-check.outputs.toggle_coursera == 'yes' || needs.yaml-check.outputs.toggle_leanpub == 'yes'}} steps: From 7ca5342daa230f760f0d975b972a61735f345dd6 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 09:51:47 -0500 Subject: [PATCH 18/25] set output_dir --- .github/workflows/render-all.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 1457301c..6a32a0fe 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -149,7 +149,8 @@ jobs: # Make new screenshots chapt_urls=$(Rscript --vanilla scripts/make_screenshots.R \ --git_pat ${{ secrets.GH_PAT }} \ - --repo $GITHUB_REPOSITORY) + --repo $GITHUB_REPOSITORY \ + --output_dir resources/chapt_screen_images) # We want a fresh run of the renders each time - name: Delete old manuscript/ From 19dc0b8a35637f51cc31916f6ed626924ecf2438 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 10:02:49 -0500 Subject: [PATCH 19/25] Update file handling --- .github/workflows/render-all.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 6a32a0fe..b6dc85ce 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -180,6 +180,7 @@ jobs: run: | git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force manuscript/* + git add --force resources/* git commit -m 'Render Leanpub' || echo "No changes to commit" git pull --allow-unrelated-histories --strategy-option=theirs git push origin main || echo "No changes to push" From 560ea2cccb04aed33b06efc3dac81fbf68580a17 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 10:08:38 -0500 Subject: [PATCH 20/25] add runs-on --- .github/workflows/transfer-rendered-files.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/transfer-rendered-files.yml b/.github/workflows/transfer-rendered-files.yml index d184e4c5..99c7ed02 100644 --- a/.github/workflows/transfer-rendered-files.yml +++ b/.github/workflows/transfer-rendered-files.yml @@ -35,6 +35,7 @@ jobs: file-quizzes-pr: name: File _Quizzes Transfer PR + runs-on: ubuntu-latest needs: [yaml-check] if: ${{needs.yaml-check.outputs.toggle_coursera == 'yes' || needs.yaml-check.outputs.toggle_leanpub == 'yes'}} From c4f9354f816d788dc95aef974deea0870ad108fe Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 10:24:03 -0500 Subject: [PATCH 21/25] Update folders that are transferred --- .github/workflows/transfer-rendered-files.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/transfer-rendered-files.yml b/.github/workflows/transfer-rendered-files.yml index 99c7ed02..4edb68d4 100644 --- a/.github/workflows/transfer-rendered-files.yml +++ b/.github/workflows/transfer-rendered-files.yml @@ -76,7 +76,7 @@ jobs: GH_PAT: ${{ secrets.GH_PAT }} run: | # Copy over images folder - svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/manuscript/resources/chapt_screen_images manuscript/resources/chapt_screen_images + svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/resources/chapt_screen_images resources/chapt_screen_images - name: Create PR with resources files if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }} From b575d76827c70285366d6c0590876a5029cf2ddf Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 10:24:45 -0500 Subject: [PATCH 22/25] Update PR comment too --- .github/workflows/transfer-rendered-files.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/transfer-rendered-files.yml b/.github/workflows/transfer-rendered-files.yml index 4edb68d4..82f96439 100644 --- a/.github/workflows/transfer-rendered-files.yml +++ b/.github/workflows/transfer-rendered-files.yml @@ -94,7 +94,7 @@ jobs: This PR was initiated by transfer-rendered.yml in the Bookdown repository. It copies over the ottrpal-needed folder (for the `bookdown_to_embed_leanpub(render = FALSE)` function to run properly. - - manuscript/resources/chapt_screen_images/* + - resources/chapt_screen_images/* labels: | automated reviewers: $GITHUB_ACTOR From 898d2bad738a878e1389cc1c3ca4e30df5f468fc Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 10:32:58 -0500 Subject: [PATCH 23/25] return defaults --- config_automation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_automation.yml b/config_automation.yml index 1660ecd4..b907b9b0 100644 --- a/config_automation.yml +++ b/config_automation.yml @@ -16,8 +16,8 @@ docker-test: no ##### Renderings run upon merge to main branch ##### # Rendering each platform's content render-bookdown: yes -render-leanpub: yes -render-coursera: yes +render-leanpub: no +render-coursera: no # What docker image should be used for rendering? # The default is jhudsl/course_template:main From 671313605b2aa395561a55b7ff2d269575ebf525 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 11:04:55 -0500 Subject: [PATCH 24/25] Restore quizzes --- coursera_quizzes/quiz_ch1.md.yml | 69 ++++++++++++++++++++++++++++++++ quizzes/quiz_ch1.md | 54 +++++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 coursera_quizzes/quiz_ch1.md.yml create mode 100644 quizzes/quiz_ch1.md diff --git a/coursera_quizzes/quiz_ch1.md.yml b/coursera_quizzes/quiz_ch1.md.yml new file mode 100644 index 00000000..b32ce87d --- /dev/null +++ b/coursera_quizzes/quiz_ch1.md.yml @@ -0,0 +1,69 @@ + +- typeName: multipleChoice + prompt: First question to ask goes here. (Note- you need a question mark at end like this. Just one is required if using a question mark in your question field)? + + shuffleOptions: true + options: + - answer: One correct answer here marked with a "C" + isCorrect: true + - answer: Mandatory incorrect answers have an "m" + isCorrect: false + - answer: A second mandatory incorrect answer + isCorrect: false + - answer: An optional incorrect answer here marked with an "o" + isCorrect: false + - answer: A second optional incorrect answer here + isCorrect: false + +- typeName: multipleChoice + prompt: Question example with just a question mark? + + shuffleOptions: true + options: + - answer: One correct answer here marked with a "C" + isCorrect: true + - answer: Mandatory incorrect answers have an "m" + isCorrect: false + - answer: A second mandatory incorrect answer + isCorrect: false + - answer: An optional incorrect answer here marked with an "o" + isCorrect: false + - answer: A second optional incorrect answer here + isCorrect: false + +- typeName: multipleChoice + prompt: Second question to ask goes here? + + shuffleOptions: true + options: + - answer: One correct answer here marked with a "C" + isCorrect: true + - answer: Mandatory incorrect answers have an "m" + isCorrect: false + - answer: A second mandatory incorrect answer + isCorrect: false + - answer: An optional incorrect answer here marked with an "o" + isCorrect: false + - answer: A second optional incorrect answer here + isCorrect: false + +- typeName: multipleChoice + prompt: A more complicated example. Note the question mark at the end of the options! Which of the following are correct + 1. An option described + 2. A second option + 3. A third option + 4. A fourth option + 5. A fifth option ? + + shuffleOptions: true + options: + - answer: All of the examples listed except 5 + isCorrect: true + - answer: 1, 3, and 5 + isCorrect: false + - answer: 1, 2, and 3 + isCorrect: false + - answer: All of the examples except 1 and 5 + isCorrect: false + - answer: All of the examples listed + isCorrect: false diff --git a/quizzes/quiz_ch1.md b/quizzes/quiz_ch1.md new file mode 100644 index 00000000..26b44552 --- /dev/null +++ b/quizzes/quiz_ch1.md @@ -0,0 +1,54 @@ + +{quiz, id: quiz_name_here, attempts: 10} + +## Template quiz + +Put any other instructions your quiz takers need to know here like: Choose the best answer. + +{choose-answers: 4} +? First question to ask goes here. (Note- you need a question mark at end like this. Just one is required if using a question mark in your question field)? + +C) One correct answer here marked with a "C" +C) A second correct answer here +m) Mandatory incorrect answers have an "m" +m) A second mandatory incorrect answer +o) An optional incorrect answer here marked with an "o" +o) A second optional incorrect answer here + +{choose-answers: 4} +? Question example with just a question mark? + +C) One correct answer here marked with a "C" +C) A second correct answer here +m) Mandatory incorrect answers have an "m" +m) A second mandatory incorrect answer +o) An optional incorrect answer here marked with an "o" +o) A second optional incorrect answer here + +{choose-answers: 4} +? Second question to ask goes here? + +C) One correct answer here marked with a "C" +C) A second correct answer here +m) Mandatory incorrect answers have an "m" +m) A second mandatory incorrect answer +o) An optional incorrect answer here marked with an "o" +o) A second optional incorrect answer here + + +{choose-answers: 4} +? A more complicated example. Note the question mark at the end of the options! Which of the following are correct +1. An option described +2. A second option +3. A third option +4. A fourth option +5. A fifth option ? + +C) All of the examples listed except 5 +C) All of the listed examples except 5 +m) 1, 3, and 5 +m) 1, 2, and 3 +o) All of the examples except 1 and 5 +o) All of the examples listed + +{/quiz} From 225a09e2719b36c9bb6046184432a7f1c40c7b60 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 18 Feb 2022 11:19:22 -0500 Subject: [PATCH 25/25] switch theirs -> ours --- .github/workflows/pull_request.yml | 20 ++++++-------------- .github/workflows/render-all.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3eb5ba10..c71bdc73 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -100,7 +100,7 @@ jobs: branch_name='preview-${{ github.event.pull_request.number }}' git add --force resources/spell_check_results.tsv git commit -m 'Add spell check file' || echo "No changes to commit" - git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=theirs + git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours git push --force origin $branch_name || echo "No changes to commit" - name: Build components of the spell check comment @@ -243,18 +243,10 @@ jobs: - name: Commit quiz check errors run: | branch_name='preview-${{ github.event.pull_request.number }}' - git diff --name-only origin/main -- question_error_report.tsv >/dev/null && changes=true || changes=false - echo $changes - if $changes == true; then - git diff --name-only origin/$branch_name question_error_report.tsv >/dev/null && changes=true || changes=false - echo $changes - if $changes == true; then - git add --force question_error_report.tsv - git diff-index --quiet HEAD || git commit -m 'Add question error report file' - git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=theirs - git push origin $branch_name - fi - fi + git add --force question_error_report.tsv || echo "No changes to commit" + git commit -m 'Add question error report file' || echo "No changes to commit" + git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours + git push origin $branch_name || echo "No changes to commit" - name: Build components of the quiz check comment id: build-components @@ -359,7 +351,7 @@ jobs: echo ::set-output name=changes::$changes git add . --force git commit -m 'Render preview' || echo "No changes to commit" - git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=theirs + git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours git push --force || echo "No changes to commit" shell: bash diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index b6dc85ce..d76dd945 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -80,7 +80,7 @@ jobs: git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/* git commit -m 'Render bookdown' || echo "No changes to commit" - git pull --allow-unrelated-histories --strategy-option=theirs + git pull --allow-unrelated-histories --strategy-option=ours git push origin main || echo "No changes to push" render-tocless: @@ -117,7 +117,7 @@ jobs: git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force docs/no_toc* git commit -m 'Render toc-less' || echo "No changes to commit" - git pull --allow-unrelated-histories --strategy-option=theirs + git pull --allow-unrelated-histories --strategy-option=ours git push origin main || echo "No changes to push" render-leanpub: @@ -173,8 +173,8 @@ jobs: chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \ make_book_txt = TRUE)" - # Commit the rendered leanpub files - - name: Commit rendered leanpub files + # Commit the rendered Leanpub files + - name: Commit rendered Leanpub files env: GH_PAT: ${{ secrets.GH_PAT }} run: | @@ -182,7 +182,7 @@ jobs: git add --force manuscript/* git add --force resources/* git commit -m 'Render Leanpub' || echo "No changes to commit" - git pull --allow-unrelated-histories --strategy-option=theirs + git pull --allow-unrelated-histories --strategy-option=ours git push origin main || echo "No changes to push" render-coursera: @@ -219,5 +219,5 @@ jobs: git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force . git commit -m 'Render Coursera quizzes' || echo "No changes to commit" - git pull --allow-unrelated-histories --strategy-option=theirs + git pull --allow-unrelated-histories --strategy-option=ours git push origin main || echo "No changes to push"