From 79b61f69a4a313a7de08aeded417111def5afbb5 Mon Sep 17 00:00:00 2001 From: howardbaek Date: Thu, 7 Sep 2023 14:45:27 -0700 Subject: [PATCH 01/82] Testing git on terminal --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 04db84a6e..e7fb81296 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Open-source Tools for Training Resources - OTTR -Go to [ottrproject.org](https://www.ottrproject.org/) to get started! :tada: +Testing git Go to [ottrproject.org](https://www.ottrproject.org/) to get started! :tada: The purpose of this course template and guide is to make course publishing maintenance across multiple different platforms _less painful_. From f84d7bf57f573a336d8f1ff0445375e06ecd2244 Mon Sep 17 00:00:00 2001 From: howardbaek Date: Thu, 7 Sep 2023 14:48:30 -0700 Subject: [PATCH 02/82] Revert changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7fb81296..04db84a6e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Open-source Tools for Training Resources - OTTR -Testing git Go to [ottrproject.org](https://www.ottrproject.org/) to get started! :tada: +Go to [ottrproject.org](https://www.ottrproject.org/) to get started! :tada: The purpose of this course template and guide is to make course publishing maintenance across multiple different platforms _less painful_. From 46dd84c504af505dbf042be994cdb1f23bdee3ef Mon Sep 17 00:00:00 2001 From: howardbaek Date: Thu, 7 Sep 2023 15:09:34 -0700 Subject: [PATCH 03/82] Initial pass at URL checker --- .github/workflows/check-url.yml | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/check-url.yml diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml new file mode 100644 index 000000000..f21558d2e --- /dev/null +++ b/.github/workflows/check-url.yml @@ -0,0 +1,42 @@ +name: Periodic URL Check + +on: + schedule: + # At 00:00 on Sundays + - cron: '0 0 * * 0' + +jobs: + + yaml-check: + name: Load user automation choices + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - 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 --global --add safe.directory $GITHUB_WORKSPACE + git config --global user.email "itcrtrainingnetwork@gmail.com" + git config --global 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 + + 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 From 274775042e9fd9ff7460c626b3dae6e7dad74566 Mon Sep 17 00:00:00 2001 From: howardbaek Date: Thu, 7 Sep 2023 15:12:06 -0700 Subject: [PATCH 04/82] Test URL checker by running every 2 mint --- .github/workflows/check-url.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index f21558d2e..1f128be32 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -2,8 +2,8 @@ name: Periodic URL Check on: schedule: - # At 00:00 on Sundays - - cron: '0 0 * * 0' + # At every 2nd minute + - cron: '*/2 * * * *' jobs: From df7515696c2de0364dac75074a1544aef2a6e31e Mon Sep 17 00:00:00 2001 From: howardbaek Date: Thu, 7 Sep 2023 15:18:18 -0700 Subject: [PATCH 05/82] Fix syntax --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 1f128be32..6986b2cb5 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -31,7 +31,7 @@ jobs: git push --set-upstream origin $branch_name shell: bash - url-check: + url-check: name: Check URLs needs: yaml-check if: ${{needs.yaml-check.outputs.toggle_url_check == 'yes'}} From 2a74a4f56951c1e285656dadc63cdee31fba54db Mon Sep 17 00:00:00 2001 From: howardbaek Date: Thu, 7 Sep 2023 15:25:21 -0700 Subject: [PATCH 06/82] Syntax --- .github/workflows/check-url.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 6986b2cb5..7894ea803 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -6,7 +6,6 @@ on: - cron: '*/2 * * * *' jobs: - yaml-check: name: Load user automation choices runs-on: ubuntu-latest @@ -17,8 +16,6 @@ jobs: fetch-depth: 0 - 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 --global --add safe.directory $GITHUB_WORKSPACE @@ -30,8 +27,7 @@ jobs: git checkout -b $branch_name || echo branch exists git push --set-upstream origin $branch_name shell: bash - - url-check: + url-check: name: Check URLs needs: yaml-check if: ${{needs.yaml-check.outputs.toggle_url_check == 'yes'}} From 4be79895606d37a1cde18c7d31fdd758556d8bd9 Mon Sep 17 00:00:00 2001 From: howardbaek Date: Thu, 7 Sep 2023 15:28:59 -0700 Subject: [PATCH 07/82] chatgpt? --- .github/workflows/check-url.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 7894ea803..6dfc7436d 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -35,4 +35,5 @@ jobs: with: check_type: urls error_min: 0 - gh_pat: secrets.GH_PAT + gh_pat: ${{ secrets.GH_PAT }} + From 80ec10d55043fae8a7b18cd116cd195a1d7936e5 Mon Sep 17 00:00:00 2001 From: Howard Baek <50791792+howardbaek@users.noreply.github.com> Date: Tue, 12 Sep 2023 13:36:50 -0500 Subject: [PATCH 08/82] Fix spacing --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 6dfc7436d..73bdc3674 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -26,7 +26,7 @@ jobs: echo branch doesnt exist git checkout -b $branch_name || echo branch exists git push --set-upstream origin $branch_name - shell: bash + shell: bash url-check: name: Check URLs needs: yaml-check From 3f8d0e51eedd8e214919ebca506e5f7bfd05e35c Mon Sep 17 00:00:00 2001 From: Howard Baek <50791792+howardbaek@users.noreply.github.com> Date: Tue, 12 Sep 2023 13:45:43 -0500 Subject: [PATCH 09/82] Remove "shell:bash" --- .github/workflows/check-url.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 73bdc3674..df72527ae 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -26,7 +26,6 @@ jobs: echo branch doesnt exist git checkout -b $branch_name || echo branch exists git push --set-upstream origin $branch_name - shell: bash url-check: name: Check URLs needs: yaml-check @@ -35,5 +34,5 @@ jobs: with: check_type: urls error_min: 0 - gh_pat: ${{ secrets.GH_PAT }} + gh_pat: secrets.GH_PAT From 407e83d872ae6b502509d0291c5198fdb6d350af Mon Sep 17 00:00:00 2001 From: Howard Baek <50791792+howardbaek@users.noreply.github.com> Date: Tue, 12 Sep 2023 13:50:20 -0500 Subject: [PATCH 10/82] Please work --- .github/workflows/check-url.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index df72527ae..3d61e997b 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -26,6 +26,7 @@ jobs: echo branch doesnt exist git checkout -b $branch_name || echo branch exists git push --set-upstream origin $branch_name + shell: bash url-check: name: Check URLs needs: yaml-check From d60a9d8f5169de7b325ef26a7a82f3f72d624a92 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 14:05:28 -0400 Subject: [PATCH 11/82] Add spacing and indents --- .github/workflows/check-url.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 3d61e997b..1f803a411 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -6,7 +6,7 @@ on: - cron: '*/2 * * * *' jobs: - yaml-check: + set-up: name: Load user automation choices runs-on: ubuntu-latest steps: @@ -14,8 +14,10 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Delete branch locally and remotely run: git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete" + - name: Make the branch fresh run: | git config --global --add safe.directory $GITHUB_WORKSPACE @@ -27,13 +29,15 @@ jobs: git checkout -b $branch_name || echo branch exists git push --set-upstream origin $branch_name shell: bash + url-check: name: Check URLs - needs: yaml-check + needs: set-up 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 + - name: Run the checks + uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main + with: + check_type: urls + error_min: 0 + gh_pat: secrets.GH_PAT From 30b104d01b5aafb1b58a0857ffb2197051767d7a Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 14:10:20 -0400 Subject: [PATCH 12/82] Fix indentation --- .github/workflows/check-url.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 1f803a411..7337be851 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -28,16 +28,10 @@ jobs: echo branch doesnt exist git checkout -b $branch_name || echo branch exists git push --set-upstream origin $branch_name - shell: bash - url-check: - name: Check URLs - needs: set-up - if: ${{needs.yaml-check.outputs.toggle_url_check == 'yes'}} - - - name: Run the checks - uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main - with: - check_type: urls - error_min: 0 - gh_pat: secrets.GH_PAT + - name: Run the checks + uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main + with: + check_type: urls + error_min: 0 + gh_pat: secrets.GH_PAT From 4f356051aab92ee4d278c2c24e373c292e659d72 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 14:14:55 -0400 Subject: [PATCH 13/82] Tryna find this indentation --- .github/workflows/check-url.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 7337be851..288e7d1a5 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -15,9 +15,6 @@ jobs: with: fetch-depth: 0 - - name: Delete branch locally and remotely - run: git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete" - - name: Make the branch fresh run: | git config --global --add safe.directory $GITHUB_WORKSPACE From e154c6bf9846161a0e270252363be9db1b9bdcef Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 14:18:58 -0400 Subject: [PATCH 14/82] Add config option --- .github/workflows/check-url.yml | 18 +++++++++++------- config_automation.yml | 2 ++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 288e7d1a5..ec4d31a85 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -2,7 +2,6 @@ name: Periodic URL Check on: schedule: - # At every 2nd minute - cron: '*/2 * * * *' jobs: @@ -25,10 +24,15 @@ jobs: echo branch doesnt exist git checkout -b $branch_name || echo branch exists git push --set-upstream origin $branch_name + outputs: + toggle_url_check_periodically: "${{ env.URL_CHECK_PERIODICALLY }}" - - name: Run the checks - uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main - with: - check_type: urls - error_min: 0 - gh_pat: secrets.GH_PAT + url-check: + name: Check URLs + needs: set-up + if: ${{needs.yaml-check.outputs.toggle_url_check_periodically == 'yes'}} + uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main + with: + check_type: urls + error_min: 0 + gh_pat: secrets.GH_PAT diff --git a/config_automation.yml b/config_automation.yml index 1c9d38a5d..1a1a57761 100644 --- a/config_automation.yml +++ b/config_automation.yml @@ -12,6 +12,8 @@ spell-check: yes style-code: yes # Test build the docker image if any docker-relevant files have been changed docker-test: no +# Should URLs be tested periodically? +url-check-periodically: yes ##### Renderings run upon merge to main branch ##### # Rendering each platform's content From fa7970075982d4dacc4d5f2be26c27a5950a8d12 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 14:20:25 -0400 Subject: [PATCH 15/82] Add workflow dispatch button too --- .github/workflows/check-url.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index ec4d31a85..c35068542 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -1,6 +1,7 @@ name: Periodic URL Check on: + workflow_dispatch: schedule: - cron: '*/2 * * * *' From 77ab7e796c19a4f32cc87a8a5820a1efd9824765 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 14:23:14 -0400 Subject: [PATCH 16/82] temporarily have a pull_request trigger --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index c35068542..da9dc6d6a 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -1,7 +1,7 @@ name: Periodic URL Check on: - workflow_dispatch: + pull_request: schedule: - cron: '*/2 * * * *' From 1a4c12ad1d6131a051d4f32d204a848e0e076ae0 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 14:25:30 -0400 Subject: [PATCH 17/82] Add URL config --- .github/workflows/check-url.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index da9dc6d6a..830d31e77 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -15,6 +15,11 @@ jobs: with: fetch-depth: 0 + - name: Load environment from YAML + uses: doughepi/yaml-env-action@v1.0.0 + with: + files: config_automation.yml # Pass a space-separated list of configuration files. Rightmost files take precedence. + - name: Make the branch fresh run: | git config --global --add safe.directory $GITHUB_WORKSPACE From a4e0f1fab2f71c300f57236d64e902797256aefd Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 14:29:24 -0400 Subject: [PATCH 18/82] Add a delete step --- .github/workflows/check-url.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 830d31e77..b28c7a3c8 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -20,6 +20,10 @@ jobs: 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" + - name: Make the branch fresh run: | git config --global --add safe.directory $GITHUB_WORKSPACE From fa608e5fc6bf92082869efcefac9fa83f8773f11 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 14:37:53 -0400 Subject: [PATCH 19/82] Fix spec --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index b28c7a3c8..46506ffb2 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -40,7 +40,7 @@ jobs: url-check: name: Check URLs needs: set-up - if: ${{needs.yaml-check.outputs.toggle_url_check_periodically == 'yes'}} + if: ${{needs.set-up.outputs.toggle_url_check_periodically == 'yes'}} uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main with: check_type: urls From 7decb8e02b53a746b0f7a5cc7977128d5ea21ec6 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 14:42:26 -0400 Subject: [PATCH 20/82] Update for branch problem --- .github/workflows/check-url.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 46506ffb2..fec351c57 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -15,6 +15,7 @@ jobs: with: fetch-depth: 0 + # Use the yaml-env-action action. - name: Load environment from YAML uses: doughepi/yaml-env-action@v1.0.0 with: @@ -24,6 +25,7 @@ jobs: - 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 --global --add safe.directory $GITHUB_WORKSPACE @@ -34,6 +36,8 @@ jobs: echo branch doesnt exist git checkout -b $branch_name || echo branch exists git push --set-upstream origin $branch_name + shell: bash + outputs: toggle_url_check_periodically: "${{ env.URL_CHECK_PERIODICALLY }}" From 65df96d186a6e12ee27e9f8a55e95d9f9f9c7a6f Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:08:50 -0400 Subject: [PATCH 21/82] Add issue creating infrastructure --- .github/ISSUE_TEMPLATE/url-error.md | 8 +++++ .github/workflows/check-url.yml | 46 +++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/url-error.md diff --git a/.github/ISSUE_TEMPLATE/url-error.md b/.github/ISSUE_TEMPLATE/url-error.md new file mode 100644 index 000000000..f2d35479b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/url-error.md @@ -0,0 +1,8 @@ +--- +title: Broken URLs found in the course! +labels: url-error +--- +URL's in this course were just checked and some broken URLs were found. + +**Number of errors:** {{ env.ERROR_NUM }} +**Number of errors:** {{ env.FILE_PATH }} diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index fec351c57..0cee1582f 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -37,7 +37,7 @@ jobs: git checkout -b $branch_name || echo branch exists git push --set-upstream origin $branch_name shell: bash - + outputs: toggle_url_check_periodically: "${{ env.URL_CHECK_PERIODICALLY }}" @@ -45,8 +45,42 @@ jobs: name: Check URLs needs: set-up if: ${{needs.set-up.outputs.toggle_url_check_periodically == 'yes'}} - uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main - with: - check_type: urls - error_min: 0 - gh_pat: secrets.GH_PAT + + - name: Run the check + uses: jhudsl/ottr-reports@main + id: check_results + continue-on-error: true + with: + check_type: urls + error_min: 1 + + - name: Declare file path and time + id: check-report + run: | + branch_name='preview-${{ github.event.pull_request.number }}' + echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/$branch_name/${{ steps.check_results.outputs.report_path }}" >> $GITHUB_OUTPUT + error_num=$(cat ${{ steps.check_results.outputs.report_path }} | wc -l) + error_num="$((error_num-1))" + echo "error_num=$error_num" >> $GITHUB_OUTPUT + error_list=$(cat ${{ steps.check_results.outputs.report_path }} + echo "error_list=$error_list" >> $GITHUB_OUTPUT + shell: bash + + - name: If too many URL errors, then make an issue + if: ${{ steps.check-report.outputs.error_num <= 1 }} + - uses: JasonEtco/create-an-issue@v2 + with: + filename: .github/ISSUE_TEMPLATE/url-error.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ERROR_LIST: ${{ steps.check_results.outputs.error_list }} + ERROR_NUM: ${{ steps.check-report.outputs.error_num }} + + - name: Stop if failure + if: steps.check_results.outcome == 'failure' + run: exit 1 + + - name: If no URL errors than delete the branch we made + if: ${{ steps.check-report.outputs.error_num <= 1 }} + run: git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete" From 6aa1c3a84b138116b76349564bec86e15b90d6b9 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:09:20 -0400 Subject: [PATCH 22/82] Add issue template --- .github/ISSUE_TEMPLATE/url-error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/url-error.md b/.github/ISSUE_TEMPLATE/url-error.md index f2d35479b..1d225b6f1 100644 --- a/.github/ISSUE_TEMPLATE/url-error.md +++ b/.github/ISSUE_TEMPLATE/url-error.md @@ -5,4 +5,4 @@ labels: url-error URL's in this course were just checked and some broken URLs were found. **Number of errors:** {{ env.ERROR_NUM }} -**Number of errors:** {{ env.FILE_PATH }} +**File_where errors are:** {{ env.FILE_PATH }} From e747bbc34c43626d26f532d0ad5cbc72039d0c27 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:12:36 -0400 Subject: [PATCH 23/82] Add steps: --- .github/ISSUE_TEMPLATE/url-error.md | 2 +- .github/workflows/check-url.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/url-error.md b/.github/ISSUE_TEMPLATE/url-error.md index 1d225b6f1..0e7f7546e 100644 --- a/.github/ISSUE_TEMPLATE/url-error.md +++ b/.github/ISSUE_TEMPLATE/url-error.md @@ -5,4 +5,4 @@ labels: url-error URL's in this course were just checked and some broken URLs were found. **Number of errors:** {{ env.ERROR_NUM }} -**File_where errors are:** {{ env.FILE_PATH }} +**File where errors are:** {{ env.FILE_PATH }} diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 0cee1582f..865600526 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -46,6 +46,7 @@ jobs: needs: set-up if: ${{needs.set-up.outputs.toggle_url_check_periodically == 'yes'}} + steps: - name: Run the check uses: jhudsl/ottr-reports@main id: check_results From 6242dc02899630e2e56121b3cbadb18b3aae81d2 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:15:09 -0400 Subject: [PATCH 24/82] Declare docker --- .github/workflows/check-url.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 865600526..88ed4f267 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -43,7 +43,9 @@ jobs: url-check: name: Check URLs - needs: set-up + runs-on: ubuntu-latest + container: + image: jhudsl/base_ottr:main if: ${{needs.set-up.outputs.toggle_url_check_periodically == 'yes'}} steps: From 4a8942e339e322e259e5445f8071da19d7e21076 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:17:09 -0400 Subject: [PATCH 25/82] get rid of dash --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 88ed4f267..1c115c020 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -72,7 +72,7 @@ jobs: - name: If too many URL errors, then make an issue if: ${{ steps.check-report.outputs.error_num <= 1 }} - - uses: JasonEtco/create-an-issue@v2 + uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md env: From 2df94c596232d5b45a80185cd9568a9fc21b363d Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:19:06 -0400 Subject: [PATCH 26/82] Move if --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 1c115c020..0c406243d 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -43,10 +43,10 @@ jobs: url-check: name: Check URLs + if: ${{needs.set-up.outputs.toggle_url_check_periodically == 'yes'}} runs-on: ubuntu-latest container: image: jhudsl/base_ottr:main - if: ${{needs.set-up.outputs.toggle_url_check_periodically == 'yes'}} steps: - name: Run the check From 2b947cc079ab82bee828515e60d1f3839bcacc7f Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:21:01 -0400 Subject: [PATCH 27/82] Add a needs argument --- .github/workflows/check-url.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 0c406243d..613a71305 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -43,6 +43,7 @@ jobs: url-check: name: Check URLs + needs: set-up if: ${{needs.set-up.outputs.toggle_url_check_periodically == 'yes'}} runs-on: ubuntu-latest container: From b84b2d5a08fe200f3ea629e9c888668f70e2b0bf Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:28:41 -0400 Subject: [PATCH 28/82] Add an option for it branch exists --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 613a71305..43a585792 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -35,7 +35,7 @@ jobs: 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 + git push --set-upstream origin $branch_name || echo echo branch exists remotely shell: bash outputs: From 26b840f160a3e6f2711486a9fed47b80ffa06bfb Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:30:54 -0400 Subject: [PATCH 29/82] missing paranthesis --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 43a585792..02a219269 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -67,7 +67,7 @@ jobs: error_num=$(cat ${{ steps.check_results.outputs.report_path }} | wc -l) error_num="$((error_num-1))" echo "error_num=$error_num" >> $GITHUB_OUTPUT - error_list=$(cat ${{ steps.check_results.outputs.report_path }} + error_list=$(cat ${{ steps.check_results.outputs.report_path }}) echo "error_list=$error_list" >> $GITHUB_OUTPUT shell: bash From 46ca8986368440931b27d404d8d916eda118fe99 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:36:18 -0400 Subject: [PATCH 30/82] Make sure its checked out --- .github/workflows/check-url.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 02a219269..abf70c2ae 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -50,6 +50,11 @@ jobs: image: jhudsl/base_ottr:main steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Run the check uses: jhudsl/ottr-reports@main id: check_results From 38091e74427fa7e7dbf5a8c23ba3a80defdb7861 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:42:34 -0400 Subject: [PATCH 31/82] Try mapfile? --- .github/workflows/check-url.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index abf70c2ae..62b81c5aa 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -66,13 +66,11 @@ jobs: - name: Declare file path and time id: check-report run: | - branch_name='preview-${{ github.event.pull_request.number }}' echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/$branch_name/${{ steps.check_results.outputs.report_path }}" >> $GITHUB_OUTPUT error_num=$(cat ${{ steps.check_results.outputs.report_path }} | wc -l) error_num="$((error_num-1))" echo "error_num=$error_num" >> $GITHUB_OUTPUT - error_list=$(cat ${{ steps.check_results.outputs.report_path }}) + error_list=$(mapfile -t myArray < ${{ steps.check_results.outputs.report_path }}) echo "error_list=$error_list" >> $GITHUB_OUTPUT shell: bash From 8dec79625ee1664caa44151720515f39b5f00018 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:44:53 -0400 Subject: [PATCH 32/82] Add a file --- .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 9316682a7..99b1bcd40 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -38,7 +38,7 @@ jobs: 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 + git push --set-upstream origin $branch_name || echo echo branch exists remotely shell: bash outputs: From a1fa04a122c1d5be509bb5fb7438ca72f5cde2c3 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:53:10 -0400 Subject: [PATCH 33/82] Didn't fix template issue --- .github/ISSUE_TEMPLATE/url-error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/url-error.md b/.github/ISSUE_TEMPLATE/url-error.md index 0e7f7546e..e740ccbb8 100644 --- a/.github/ISSUE_TEMPLATE/url-error.md +++ b/.github/ISSUE_TEMPLATE/url-error.md @@ -5,4 +5,4 @@ labels: url-error URL's in this course were just checked and some broken URLs were found. **Number of errors:** {{ env.ERROR_NUM }} -**File where errors are:** {{ env.FILE_PATH }} +**File where errors are:** {{ env.ERROR_LIST }} From 3a4dac523e0848257b90272a37efffdfc5543f12 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 20 Sep 2023 15:58:27 -0400 Subject: [PATCH 34/82] Put file link --- .github/ISSUE_TEMPLATE/url-error.md | 2 +- .github/workflows/check-url.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/url-error.md b/.github/ISSUE_TEMPLATE/url-error.md index e740ccbb8..fe1319662 100644 --- a/.github/ISSUE_TEMPLATE/url-error.md +++ b/.github/ISSUE_TEMPLATE/url-error.md @@ -5,4 +5,4 @@ labels: url-error URL's in this course were just checked and some broken URLs were found. **Number of errors:** {{ env.ERROR_NUM }} -**File where errors are:** {{ env.ERROR_LIST }} +**File where errors are:** [url checks file here]({{ env.FILE_URL }}) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 62b81c5aa..0eba2c748 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -66,12 +66,10 @@ jobs: - name: Declare file path and time id: check-report run: | - echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT error_num=$(cat ${{ steps.check_results.outputs.report_path }} | wc -l) error_num="$((error_num-1))" echo "error_num=$error_num" >> $GITHUB_OUTPUT - error_list=$(mapfile -t myArray < ${{ steps.check_results.outputs.report_path }}) - echo "error_list=$error_list" >> $GITHUB_OUTPUT + echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/$branch_name/${{ steps.check_results.outputs.report_path }}" >> $GITHUB_OUTPUT shell: bash - name: If too many URL errors, then make an issue @@ -81,7 +79,7 @@ jobs: filename: .github/ISSUE_TEMPLATE/url-error.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ERROR_LIST: ${{ steps.check_results.outputs.error_list }} + FILE_URL: ${{ steps.check_results.outputs.error_url }} ERROR_NUM: ${{ steps.check-report.outputs.error_num }} - name: Stop if failure @@ -90,4 +88,6 @@ jobs: - name: If no URL errors than delete the branch we made if: ${{ steps.check-report.outputs.error_num <= 1 }} - run: git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete" + run: | + git config --system --add safe.directory "$GITHUB_WORKSPACE" + git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete" From 7cd6c56d287866f95b6b965fa007e5a4fdd4d5e1 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 21 Sep 2023 08:09:24 -0400 Subject: [PATCH 35/82] Fix link --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 0eba2c748..888a509e8 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -79,7 +79,7 @@ jobs: filename: .github/ISSUE_TEMPLATE/url-error.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FILE_URL: ${{ steps.check_results.outputs.error_url }} + FILE_URL: ${{ steps.check-report.outputs.error_url }} ERROR_NUM: ${{ steps.check-report.outputs.error_num }} - name: Stop if failure From 05563a1c5dd06bd42b219915a1d9c5460c126f6e Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 21 Sep 2023 08:14:49 -0400 Subject: [PATCH 36/82] Fix less than or greater than --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 888a509e8..fd978538c 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -73,7 +73,7 @@ jobs: shell: bash - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num <= 1 }} + if: ${{ steps.check-report.outputs.error_num > 1 }} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md From da60ae3ef1f213303f7e3c6fe9b7928637b9bb7b Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 21 Sep 2023 08:30:52 -0400 Subject: [PATCH 37/82] Add in a spelling error to check if this works --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 04db84a6e..82b4460d0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ ## Open-source Tools for Training Resources - OTTR +spling rror + Go to [ottrproject.org](https://www.ottrproject.org/) to get started! :tada: The purpose of this course template and guide is to make course publishing maintenance across multiple different platforms _less painful_. @@ -30,4 +32,3 @@ _This template and guide helps you_: - Check out our [course on using Leanpub](https://hutchdatascience.org/Using_Leanpub/index.html) for help publishing on this platform. - Please take a look at the [code of conduct](./code_of_conduct.md). - If you encounter any problems or have ideas for improvements to this template repository or this getting started guide, please [file an issue here](https://github.com/jhudsl/OTTR_Template/issues/new/choose)! Your feedback is very much appreciated. - From 2a9b34b78c3e7d94b9969bff98f2c37293d9a16d Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 21 Sep 2023 08:33:56 -0400 Subject: [PATCH 38/82] Add spelling errors to test part 2 --- 01-intro.Rmd | 2 ++ README.md | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/01-intro.Rmd b/01-intro.Rmd index 886eb5281..598959894 100644 --- a/01-intro.Rmd +++ b/01-intro.Rmd @@ -5,6 +5,8 @@ ottrpal::set_knitr_image_path() # Introduction +spling rror +baiusbdfius ## Motivation diff --git a/README.md b/README.md index 82b4460d0..44ebd89d1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ ## Open-source Tools for Training Resources - OTTR -spling rror - Go to [ottrproject.org](https://www.ottrproject.org/) to get started! :tada: The purpose of this course template and guide is to make course publishing maintenance across multiple different platforms _less painful_. From 91e68e3cbe0bf308ee83e3db97e64a484a31fd5d Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 21 Sep 2023 08:40:53 -0400 Subject: [PATCH 39/82] Try to fix --- .github/workflows/check-url.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index fd978538c..d55e51cf0 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -72,8 +72,17 @@ jobs: echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/$branch_name/${{ steps.check_results.outputs.report_path }}" >> $GITHUB_OUTPUT shell: bash + - name: Stop if failure + if: steps.check_results.outcome == 'failure' + run: exit 1 + + - name: Print out error variables + run: | + echo ${{ steps.check-report.outputs.error_url }} + echo ${{ steps.check-report.outputs.error_num }} + - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num > 1 }} + if: ${{ steps.check-report.outputs.error_num => 1 }} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md @@ -82,12 +91,8 @@ jobs: FILE_URL: ${{ steps.check-report.outputs.error_url }} ERROR_NUM: ${{ steps.check-report.outputs.error_num }} - - name: Stop if failure - if: steps.check_results.outcome == 'failure' - run: exit 1 - - name: If no URL errors than delete the branch we made - if: ${{ steps.check-report.outputs.error_num <= 1 }} + if: ${{ steps.check-report.outputs.error_num < 1 }} run: | git config --system --add safe.directory "$GITHUB_WORKSPACE" git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete" From 418686c88c59c120659ddd0769adaf445d6d1c6e Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 21 Sep 2023 08:44:58 -0400 Subject: [PATCH 40/82] Reverse order or < and = --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index d55e51cf0..ebfd0b418 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -82,7 +82,7 @@ jobs: echo ${{ steps.check-report.outputs.error_num }} - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num => 1 }} + if: ${{ steps.check-report.outputs.error_num >= 1 }} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md From 6ed286dbff64d934ab180b7e5485b97bf1f4de7e Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 21 Sep 2023 08:50:01 -0400 Subject: [PATCH 41/82] Change branch name --- .github/workflows/check-url.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index ebfd0b418..1cc48ed0e 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -23,7 +23,7 @@ jobs: # 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" + run: git push origin --delete preview-spell-error || echo "No branch to delete" # Make the branch fresh - name: Make the branch fresh @@ -32,10 +32,9 @@ jobs: git config --global user.email "itcrtrainingnetwork@gmail.com" git config --global 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 || echo echo branch exists remotely + git checkout -b preview-spell-error || echo branch exists + git push --set-upstream origin preview-spell-error || echo echo branch exists remotely shell: bash outputs: @@ -69,7 +68,7 @@ jobs: error_num=$(cat ${{ steps.check_results.outputs.report_path }} | wc -l) error_num="$((error_num-1))" echo "error_num=$error_num" >> $GITHUB_OUTPUT - echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/$branch_name/${{ steps.check_results.outputs.report_path }}" >> $GITHUB_OUTPUT + echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/preview-spell-error/${{ steps.check_results.outputs.report_path }}" >> $GITHUB_OUTPUT shell: bash - name: Stop if failure @@ -95,4 +94,4 @@ jobs: if: ${{ steps.check-report.outputs.error_num < 1 }} run: | git config --system --add safe.directory "$GITHUB_WORKSPACE" - git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete" + git push origin --delete preview-spell-error || echo "No branch to delete" From 500506c456288dcd372042b6a20ed550731683c1 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 21 Sep 2023 09:05:43 -0400 Subject: [PATCH 42/82] Make sure branch is checked out --- .github/workflows/check-url.yml | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 1cc48ed0e..f95d7f5cb 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -21,22 +21,6 @@ jobs: 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-spell-error || echo "No branch to delete" - - # Make the branch fresh - - name: Make the branch fresh - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git config --global user.email "itcrtrainingnetwork@gmail.com" - git config --global user.name "jhudsl-robot" - - echo branch doesnt exist - git checkout -b preview-spell-error || echo branch exists - git push --set-upstream origin preview-spell-error || echo echo branch exists remotely - shell: bash - outputs: toggle_url_check_periodically: "${{ env.URL_CHECK_PERIODICALLY }}" @@ -54,6 +38,22 @@ jobs: with: fetch-depth: 0 + # Delete the branch if this has been run before + - name: Delete branch locally and remotely + run: git push origin --delete preview-spell-error || echo "No branch to delete" + + # Make the branch fresh + - name: Make the branch fresh + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + git config --global user.email "itcrtrainingnetwork@gmail.com" + git config --global user.name "jhudsl-robot" + + echo branch doesnt exist + git checkout -b preview-spell-error || echo branch exists + git push --set-upstream origin preview-spell-error || echo echo branch exists remotely + shell: bash + - name: Run the check uses: jhudsl/ottr-reports@main id: check_results @@ -65,10 +65,10 @@ jobs: - name: Declare file path and time id: check-report run: | - error_num=$(cat ${{ steps.check_results.outputs.report_path }} | wc -l) + error_num=$(cat check_reports/url_checks.tsv | wc -l) error_num="$((error_num-1))" echo "error_num=$error_num" >> $GITHUB_OUTPUT - echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/preview-spell-error/${{ steps.check_results.outputs.report_path }}" >> $GITHUB_OUTPUT + echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/preview-spell-error/check_reports/url_checks.tsv" >> $GITHUB_OUTPUT shell: bash - name: Stop if failure From c3f6ac84446967643b72a564f6437b19277dbc95 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 21 Sep 2023 09:12:29 -0400 Subject: [PATCH 43/82] Look for an issue --- .github/workflows/check-url.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index f95d7f5cb..d6a09da9c 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -80,8 +80,16 @@ jobs: echo ${{ steps.check-report.outputs.error_url }} echo ${{ steps.check-report.outputs.error_num }} + - name: Check if Issue Exists + uses: nickderobertis/check-if-issue-exists-action@master + id: check_if_issue_exists + with: + repo: ${GITHUB_REPOSITORY} + token: ${{ secrets.GITHUB_TOKEN }} + title: Broken URLs found in the course! + - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num >= 1 }} + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.check_if_issue_exists.outputs.exists == 'false'}} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md From 641875a852b37e0136bcb96d99650f8b13ab1c52 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 21 Sep 2023 09:28:59 -0400 Subject: [PATCH 44/82] Trying a different issue finder --- .github/workflows/check-url.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index d6a09da9c..6918eb538 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -80,16 +80,17 @@ jobs: echo ${{ steps.check-report.outputs.error_url }} echo ${{ steps.check-report.outputs.error_num }} - - name: Check if Issue Exists - uses: nickderobertis/check-if-issue-exists-action@master - id: check_if_issue_exists + - name: Find issues + uses: actions-cool/issues-helper@v3 + id: find-issue with: - repo: ${GITHUB_REPOSITORY} + actions: 'find-issues' token: ${{ secrets.GITHUB_TOKEN }} - title: Broken URLs found in the course! + issue-state: 'open' + title-includes: 'Broken URLs found in the course!' - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num >= 1 && steps.check_if_issue_exists.outputs.exists == 'false'}} + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.exists == 'false'}} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md From 3c24629588eadb5651140ce4c0180b021ad0181e Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 22 Sep 2023 08:27:54 -0400 Subject: [PATCH 45/82] Gonna make my own issue finder --- .github/workflows/check-url.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 6918eb538..96e496b95 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -81,13 +81,6 @@ jobs: echo ${{ steps.check-report.outputs.error_num }} - name: Find issues - uses: actions-cool/issues-helper@v3 - id: find-issue - with: - actions: 'find-issues' - token: ${{ secrets.GITHUB_TOKEN }} - issue-state: 'open' - title-includes: 'Broken URLs found in the course!' - name: If too many URL errors, then make an issue if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.exists == 'false'}} From 590933f492104f532a63bcfc024e55883934fc01 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 22 Sep 2023 10:53:33 -0400 Subject: [PATCH 46/82] Add find issue bits --- .github/workflows/check-url.yml | 7 +++++- scripts/find_issue.R | 44 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 scripts/find_issue.R diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 96e496b95..c516c317f 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -81,9 +81,14 @@ jobs: echo ${{ steps.check-report.outputs.error_num }} - name: Find issues + id: find-issue + run: | + issue_exists=$(Rscript --vanilla scripts/find_issue.R --repo "$GITHUB_REPOSITORY" --git_pat "$GH_PAT") + echo URL issue exists: $issue_exists + echo "issue_exists=$issue_exists" >> $GITHUB_OUTPUT - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.exists == 'false'}} + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == 'FALSE'}} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md diff --git a/scripts/find_issue.R b/scripts/find_issue.R new file mode 100644 index 000000000..c242ffdbc --- /dev/null +++ b/scripts/find_issue.R @@ -0,0 +1,44 @@ +#!/usr/bin/env Rscript + +# Written by Candace Savonen Sept 2021 + +if (!("optparse" %in% installed.packages())){ + install.packages("optparse") +} + +library(optparse) + +option_list <- list( + optparse::make_option( + c("--repo"), + type = "character", + default = NULL, + help = "GitHub repository name, e.g. jhudsl/OTTR_Template", + ), + optparse::make_option( + c("--git_pat"), + type = "character", + default = NULL, + help = "GitHub personal access token", + ) +) + +# Read the arguments passed +opt_parser <- optparse::OptionParser(option_list = option_list) +opt <- optparse::parse_args(opt_parser) + +repo <- opt$repo +git_pat <- opt$git_pat + +if (!is.character(repo)) { + repo <- as.character(repo) +} + +install.packages('githubr') + +issue_titles <- get_issues(opt$repo)$title, git_pat = opt$git_pat) + +issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) + +# Print out the result +write(issue_exists, stdout()) From feb31b876be8742c663093c108cda82082286567 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 22 Sep 2023 11:04:12 -0400 Subject: [PATCH 47/82] Add CRAN mirror --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index c242ffdbc..a6f4e3574 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -34,7 +34,7 @@ if (!is.character(repo)) { repo <- as.character(repo) } -install.packages('githubr') +install.packages('githubr', repos='http://cran.us.r-project.org') issue_titles <- get_issues(opt$repo)$title, git_pat = opt$git_pat) From 1e50a2d9c0e748de212854e87bb17583dad4e21d Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 22 Sep 2023 11:25:58 -0400 Subject: [PATCH 48/82] Fix syntax --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index a6f4e3574..d00fefcec 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -36,7 +36,7 @@ if (!is.character(repo)) { install.packages('githubr', repos='http://cran.us.r-project.org') -issue_titles <- get_issues(opt$repo)$title, git_pat = opt$git_pat) +issue_titles <- get_issues(opt$repo, git_pat = opt$git_pat)$title issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) From e08c9e103e0ae96f3c836d4b97c4a84d76bd3fd3 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 22 Sep 2023 13:07:49 -0400 Subject: [PATCH 49/82] Delete spelling errors --- 01-intro.Rmd | 2 -- 1 file changed, 2 deletions(-) diff --git a/01-intro.Rmd b/01-intro.Rmd index 598959894..886eb5281 100644 --- a/01-intro.Rmd +++ b/01-intro.Rmd @@ -5,8 +5,6 @@ ottrpal::set_knitr_image_path() # Introduction -spling rror -baiusbdfius ## Motivation From a3e2dd93cd308ac6b5b2f838033a5f6816156979 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Tue, 24 Oct 2023 08:28:53 -0400 Subject: [PATCH 50/82] Add a missing githubr:: --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index d00fefcec..7551a179b 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -36,7 +36,7 @@ if (!is.character(repo)) { install.packages('githubr', repos='http://cran.us.r-project.org') -issue_titles <- get_issues(opt$repo, git_pat = opt$git_pat)$title +issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) From 3df3e40b966f38eaffea634d1b8bfa3cbeff8344 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Tue, 24 Oct 2023 10:01:54 -0400 Subject: [PATCH 51/82] Install from github --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 7551a179b..8d7cc34b6 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -34,7 +34,7 @@ if (!is.character(repo)) { repo <- as.character(repo) } -install.packages('githubr', repos='http://cran.us.r-project.org') +remotes::install_github("fhdsl/githubr", auth_token = opt$git_pat) issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title From c640fe33b75cf3498e270c5f8043e455c7ec2eca Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Tue, 24 Oct 2023 10:09:39 -0400 Subject: [PATCH 52/82] Fix GH_PAT --- .github/workflows/check-url.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index c516c317f..2329561c2 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -82,6 +82,8 @@ jobs: - name: Find issues id: find-issue + env: + GH_PAT: ${{ secrets.GH_PAT }} run: | issue_exists=$(Rscript --vanilla scripts/find_issue.R --repo "$GITHUB_REPOSITORY" --git_pat "$GH_PAT") echo URL issue exists: $issue_exists From ebc0d47ffac742e8082d4c012525007e202c1c8f Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Tue, 24 Oct 2023 10:18:39 -0400 Subject: [PATCH 53/82] Install from CRAN again --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 8d7cc34b6..7551a179b 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -34,7 +34,7 @@ if (!is.character(repo)) { repo <- as.character(repo) } -remotes::install_github("fhdsl/githubr", auth_token = opt$git_pat) +install.packages('githubr', repos='http://cran.us.r-project.org') issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title From 1580cc847a27e623382b485aa3c1e048a3c09f81 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Tue, 24 Oct 2023 11:03:22 -0400 Subject: [PATCH 54/82] Install from github but use devtools --- scripts/find_issue.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 7551a179b..f9661da57 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -34,7 +34,8 @@ if (!is.character(repo)) { repo <- as.character(repo) } -install.packages('githubr', repos='http://cran.us.r-project.org') +# install.packages('githubr', repos='http://cran.us.r-project.org') +devtools::install_github("fhdsl/githubr", auth_token = opt$git_pat) issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title From cde9b610a2436f12cc4c8b26a62614ad35461bad Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Tue, 24 Oct 2023 11:12:13 -0400 Subject: [PATCH 55/82] dependencies = TRUE --- scripts/find_issue.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index f9661da57..2baf95e5d 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -35,11 +35,11 @@ if (!is.character(repo)) { } # install.packages('githubr', repos='http://cran.us.r-project.org') -devtools::install_github("fhdsl/githubr", auth_token = opt$git_pat) +devtools::install_github("fhdsl/githubr", auth_token = opt$git_pat, dependencies = TRUE) issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) # Print out the result -write(issue_exists, stdout()) +write(as.character(issue_exists), stdout()) From 0d97f4a622dfa68d11cd67d908ef3b990fd13310 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Tue, 24 Oct 2023 14:04:22 -0400 Subject: [PATCH 56/82] Install from CRAN instead --- scripts/find_issue.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 2baf95e5d..9f3b3ee3d 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -34,8 +34,8 @@ if (!is.character(repo)) { repo <- as.character(repo) } -# install.packages('githubr', repos='http://cran.us.r-project.org') -devtools::install_github("fhdsl/githubr", auth_token = opt$git_pat, dependencies = TRUE) +install.packages('githubr', repos='http://cran.us.r-project.org') +# devtools::install_github("fhdsl/githubr", auth_token = opt$git_pat, dependencies = TRUE) issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title From 77848065a7af1251ebe64844e61b7afde4ec2abe Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 25 Oct 2023 08:38:51 -0400 Subject: [PATCH 57/82] Test variables --- .github/workflows/check-url.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 2329561c2..ba7705f41 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -85,7 +85,9 @@ jobs: env: GH_PAT: ${{ secrets.GH_PAT }} run: | - issue_exists=$(Rscript --vanilla scripts/find_issue.R --repo "$GITHUB_REPOSITORY" --git_pat "$GH_PAT") + echo "$GH_PAT" + echo "$GITHUB_REPOSITORY" + issue_exists=$(Rscript --vanilla scripts/find_issue.R --repo $GITHUB_REPOSITORY --git_pat $GH_PAT) echo URL issue exists: $issue_exists echo "issue_exists=$issue_exists" >> $GITHUB_OUTPUT From a04720a9963ce1333319708b3996992dcc3c1c00 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 2 Nov 2023 13:44:28 -0400 Subject: [PATCH 58/82] Retrigger a run for GHA --- .github/workflows/check-url.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index ba7705f41..6320efa5f 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -20,7 +20,6 @@ jobs: uses: doughepi/yaml-env-action@v1.0.0 with: files: config_automation.yml # Pass a space-separated list of configuration files. Rightmost files take precedence. - outputs: toggle_url_check_periodically: "${{ env.URL_CHECK_PERIODICALLY }}" From 891d5bed829b08667c4837c408a9e4ac5c07722f Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 2 Nov 2023 13:53:35 -0400 Subject: [PATCH 59/82] Print out session info --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 9f3b3ee3d..2cad65957 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -42,4 +42,4 @@ issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) # Print out the result -write(as.character(issue_exists), stdout()) +write(sessionInfo(), stdout()) From 918083df3264c942f73984b8788f164a9de5b3ba Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 2 Nov 2023 13:54:24 -0400 Subject: [PATCH 60/82] Actually what I did won't work! --- scripts/find_issue.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 2cad65957..fe0a8ff61 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -23,6 +23,9 @@ option_list <- list( ) ) +# Print out the result +write(sessionInfo(), stdout()) + # Read the arguments passed opt_parser <- optparse::OptionParser(option_list = option_list) opt <- optparse::parse_args(opt_parser) @@ -42,4 +45,4 @@ issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) # Print out the result -write(sessionInfo(), stdout()) +write(as.character(issue_exists), stdout()) From 3b2dc08332282f6220e329b486e06c29bfff05dc Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 2 Nov 2023 13:57:17 -0400 Subject: [PATCH 61/82] use cat() instead --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index fe0a8ff61..21dd39004 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -24,7 +24,7 @@ option_list <- list( ) # Print out the result -write(sessionInfo(), stdout()) +cat(sessionInfo()) # Read the arguments passed opt_parser <- optparse::OptionParser(option_list = option_list) From 3dde5185e39c9c880fb535de6d85bccec3ccd246 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 2 Nov 2023 14:37:09 -0400 Subject: [PATCH 62/82] unlist --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 21dd39004..cd300a1a0 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -24,7 +24,7 @@ option_list <- list( ) # Print out the result -cat(sessionInfo()) +unlist(sessionInfo()) # Read the arguments passed opt_parser <- optparse::OptionParser(option_list = option_list) From cc733bad1af05f9ad95abf194a54cb2a1792833f Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 2 Nov 2023 14:40:58 -0400 Subject: [PATCH 63/82] I need cat() too --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index cd300a1a0..3053c6f1b 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -24,7 +24,7 @@ option_list <- list( ) # Print out the result -unlist(sessionInfo()) +cat(unlist(sessionInfo())) # Read the arguments passed opt_parser <- optparse::OptionParser(option_list = option_list) From 7d6e766e93f83230fb9fa47c234d21b1f78ceccc Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 2 Nov 2023 14:45:40 -0400 Subject: [PATCH 64/82] Why is GHA not printing this out? Try message() --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 3053c6f1b..366ddd8cd 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -24,7 +24,7 @@ option_list <- list( ) # Print out the result -cat(unlist(sessionInfo())) +message(unlist(sessionInfo())) # Read the arguments passed opt_parser <- optparse::OptionParser(option_list = option_list) From 4c489387ea3c521f439b0eb64cb536262bcc28c7 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 2 Nov 2023 14:54:18 -0400 Subject: [PATCH 65/82] Save session info to a file and archive upload it --- .github/workflows/check-url.yml | 8 ++++++++ scripts/find_issue.R | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 6320efa5f..680c28f23 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -90,6 +90,14 @@ jobs: echo URL issue exists: $issue_exists echo "issue_exists=$issue_exists" >> $GITHUB_OUTPUT + # We want to retrieve this file after this runs so we can see what spell check errors were detected + - name: Archive session info + uses: actions/upload-artifact@v3 + # These arguments underneath `with` are generally action specific so we have to check the documentation: https://github.com/marketplace/actions/upload-a-build-artifact + with: + name: session_info.txt + path: session_info.txt + - name: If too many URL errors, then make an issue if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == 'FALSE'}} uses: JasonEtco/create-an-issue@v2 diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 366ddd8cd..1baface59 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -24,7 +24,7 @@ option_list <- list( ) # Print out the result -message(unlist(sessionInfo())) +write(unlist(sessionInfo()), "session_info.txt") # Read the arguments passed opt_parser <- optparse::OptionParser(option_list = option_list) From 8403a7e200a22a688765122d90642d3aced6aa05 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 2 Nov 2023 14:56:19 -0400 Subject: [PATCH 66/82] Shut off the other things so this step completes --- scripts/find_issue.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 1baface59..195914376 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -40,9 +40,9 @@ if (!is.character(repo)) { install.packages('githubr', repos='http://cran.us.r-project.org') # devtools::install_github("fhdsl/githubr", auth_token = opt$git_pat, dependencies = TRUE) -issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title +# issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title -issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) +#issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) # Print out the result write(as.character(issue_exists), stdout()) From 8a51b458dc6496047e1bd581d0394b1a0386d892 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Thu, 2 Nov 2023 15:00:00 -0400 Subject: [PATCH 67/82] Comment out one more step --- scripts/find_issue.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 195914376..cf287a7e1 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -37,7 +37,7 @@ if (!is.character(repo)) { repo <- as.character(repo) } -install.packages('githubr', repos='http://cran.us.r-project.org') +# install.packages('githubr', repos='http://cran.us.r-project.org') # devtools::install_github("fhdsl/githubr", auth_token = opt$git_pat, dependencies = TRUE) # issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title @@ -45,4 +45,4 @@ install.packages('githubr', repos='http://cran.us.r-project.org') #issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) # Print out the result -write(as.character(issue_exists), stdout()) +# write(as.character(issue_exists), stdout()) From d76574b097df294f99271c07442e9427fbda0671 Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 08:17:17 -0500 Subject: [PATCH 68/82] Order dictionary.txt --- OTTR_template.Rproj | 17 ++++++++++++++++ resources/dictionary.txt | 42 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 OTTR_template.Rproj diff --git a/OTTR_template.Rproj b/OTTR_template.Rproj new file mode 100644 index 000000000..628359e14 --- /dev/null +++ b/OTTR_template.Rproj @@ -0,0 +1,17 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: knitr +LaTeX: pdfLaTeX + +AutoAppendNewline: Yes + +BuildType: Website diff --git a/resources/dictionary.txt b/resources/dictionary.txt index e3afe6f18..1520d003f 100644 --- a/resources/dictionary.txt +++ b/resources/dictionary.txt @@ -1,33 +1,67 @@ AnVIL +Audiographer +Audiography +automagic BIPOC Bloomberg Bookdown +chapt Coursera +creativecommons css Datatrail DataTrail +DISCOVERABLE Dockerfile Dockerhub dropdown +enforceability +faq favicon +FirstName +Funder +fyi GDSCN -GitHub -Github +Generis GH +Github +GitHub +https +ies +iframe +immunities impactful ITCR itcrtraining ITN -fyi +LastName Leanpub +Licensor +LICENSOR Markua mentorship +MERCHANTABILITY +Muschelli NCI NHGRI +OTTR ottrpal +ottrproject Pandoc +png +pre +reproducibility +rmarkdown +RMarkdown +Savonen +sexualized +socio +synched +tada UE UE5 -reproducibility underserved +Videographer +Videography +WIPO www From 7baf79ba494123ffe80ea142a1b997e6f7ce9b7b Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 08:18:02 -0500 Subject: [PATCH 69/82] Add broken URL --- 01-intro.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01-intro.Rmd b/01-intro.Rmd index 886eb5281..ced897ddb 100644 --- a/01-intro.Rmd +++ b/01-intro.Rmd @@ -4,7 +4,7 @@ ottrpal::set_knitr_image_path() ``` # Introduction - +https://ahuidshiushiufhs.com ## Motivation From 45eb1a191a1286ca77cfb9b0fe460005e5b669ea Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 08:22:12 -0500 Subject: [PATCH 70/82] Make it so blank is the logic --- .github/workflows/check-url.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 680c28f23..bef6d6697 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -91,7 +91,7 @@ jobs: echo "issue_exists=$issue_exists" >> $GITHUB_OUTPUT # We want to retrieve this file after this runs so we can see what spell check errors were detected - - name: Archive session info + - name: Archive session info uses: actions/upload-artifact@v3 # These arguments underneath `with` are generally action specific so we have to check the documentation: https://github.com/marketplace/actions/upload-a-build-artifact with: @@ -99,7 +99,7 @@ jobs: path: session_info.txt - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == 'FALSE'}} + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == ''}} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md From f8d555e1b2d88e9b610947e769eb3549969a8a56 Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 08:25:03 -0500 Subject: [PATCH 71/82] Just retrigger the check --- 01-intro.Rmd | 1 + 1 file changed, 1 insertion(+) diff --git a/01-intro.Rmd b/01-intro.Rmd index ced897ddb..622874d63 100644 --- a/01-intro.Rmd +++ b/01-intro.Rmd @@ -6,6 +6,7 @@ ottrpal::set_knitr_image_path() # Introduction https://ahuidshiushiufhs.com + ## Motivation From a2ffbceb76cdfbade44332387833622680e79f3f Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 08:31:55 -0500 Subject: [PATCH 72/82] Try again --- .github/workflows/check-url.yml | 2 +- scripts/find_issue.R | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index bef6d6697..44d54e8e3 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -99,7 +99,7 @@ jobs: path: session_info.txt - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == ''}} + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == TRUE}} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md diff --git a/scripts/find_issue.R b/scripts/find_issue.R index cf287a7e1..4214162a6 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -37,12 +37,11 @@ if (!is.character(repo)) { repo <- as.character(repo) } -# install.packages('githubr', repos='http://cran.us.r-project.org') -# devtools::install_github("fhdsl/githubr", auth_token = opt$git_pat, dependencies = TRUE) +install.packages('githubr', repos='http://cran.us.r-project.org') -# issue_titles <- githubr::get_issues(opt$repo, git_pat = opt$git_pat)$title +issue_titles <- githubr::get_issues(repo, git_pat = git_pat)$title -#issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) +issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) # Print out the result -# write(as.character(issue_exists), stdout()) +write(as.character(issue_exists), stdout()) From 18ee7b48f092d013db24410d5a685c64f9a99d9c Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 08:35:29 -0500 Subject: [PATCH 73/82] fix true --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 44d54e8e3..f6198dfd6 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -99,7 +99,7 @@ jobs: path: session_info.txt - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == TRUE}} + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == 'true'}} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md From dc6c371fdbe0c0474a8bacaf713c2d66bbf2ab23 Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 08:42:46 -0500 Subject: [PATCH 74/82] drop quotes --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index f6198dfd6..983a435cc 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -99,7 +99,7 @@ jobs: path: session_info.txt - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == 'true'}} + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == true}} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md From b85042a5fee26bf1b876ff3b52dcacb3f22538fd Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 08:51:09 -0500 Subject: [PATCH 75/82] Let's try this --- scripts/find_issue.R | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 4214162a6..f3783e719 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -23,9 +23,6 @@ option_list <- list( ) ) -# Print out the result -write(unlist(sessionInfo()), "session_info.txt") - # Read the arguments passed opt_parser <- optparse::OptionParser(option_list = option_list) opt <- optparse::parse_args(opt_parser) @@ -37,9 +34,11 @@ if (!is.character(repo)) { repo <- as.character(repo) } -install.packages('githubr', repos='http://cran.us.r-project.org') +install.packages('gh', repos='http://cran.us.r-project.org') -issue_titles <- githubr::get_issues(repo, git_pat = git_pat)$title +my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", repo = repo_name, .token = git_pat, per_page = "max") +my_issues <- unlist(my_issues) +issue_titles <- my_issues[which(names(my_issues) == "title")] issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) From e364016f60694bea10e412d8a47e963f0d2f0c6e Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 08:54:07 -0500 Subject: [PATCH 76/82] repo_name -> repo --- scripts/find_issue.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index f3783e719..4f25b6038 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -36,7 +36,7 @@ if (!is.character(repo)) { install.packages('gh', repos='http://cran.us.r-project.org') -my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", repo = repo_name, .token = git_pat, per_page = "max") +my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", repo = repo, .token = git_pat, per_page = "max") my_issues <- unlist(my_issues) issue_titles <- my_issues[which(names(my_issues) == "title")] From 3093c4c4cbfd674b287ae6f251e674abb4376c3f Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 08:59:43 -0500 Subject: [PATCH 77/82] change per_page --- scripts/find_issue.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 4f25b6038..7a3f753f7 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -36,7 +36,10 @@ if (!is.character(repo)) { install.packages('gh', repos='http://cran.us.r-project.org') -my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", repo = repo, .token = git_pat, per_page = "max") +my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", + repo = repo, + .token = git_pat, + per_page = 100) my_issues <- unlist(my_issues) issue_titles <- my_issues[which(names(my_issues) == "title")] From 526c91712e7873779b2c3bb96984ed725e40ade6 Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 09:09:06 -0500 Subject: [PATCH 78/82] mysterious error --- .github/workflows/check-url.yml | 12 ++---------- scripts/find_issue.R | 10 +++++----- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 983a435cc..9e1c790ea 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -88,18 +88,10 @@ jobs: echo "$GITHUB_REPOSITORY" issue_exists=$(Rscript --vanilla scripts/find_issue.R --repo $GITHUB_REPOSITORY --git_pat $GH_PAT) echo URL issue exists: $issue_exists - echo "issue_exists=$issue_exists" >> $GITHUB_OUTPUT - - # We want to retrieve this file after this runs so we can see what spell check errors were detected - - name: Archive session info - uses: actions/upload-artifact@v3 - # These arguments underneath `with` are generally action specific so we have to check the documentation: https://github.com/marketplace/actions/upload-a-build-artifact - with: - name: session_info.txt - path: session_info.txt + echo "issue_existence=$issue_exists" >> $GITHUB_OUTPUT - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == true}} + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_existence >= 1}} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 7a3f753f7..d9646a36a 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -36,14 +36,14 @@ if (!is.character(repo)) { install.packages('gh', repos='http://cran.us.r-project.org') -my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", - repo = repo, - .token = git_pat, - per_page = 100) +my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", + repo = repo, + .token = git_pat) + my_issues <- unlist(my_issues) issue_titles <- my_issues[which(names(my_issues) == "title")] issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) # Print out the result -write(as.character(issue_exists), stdout()) +write(length(issue_exists), stdout()) From 2405c61b1f48ece8c8308e088a4a56882fd3f184 Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 09:17:03 -0500 Subject: [PATCH 79/82] Print out clues --- scripts/find_issue.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index d9646a36a..4178fde8e 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -40,6 +40,9 @@ my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", repo = repo, .token = git_pat) +# Print out the result +write(my_issues, stdout()) + my_issues <- unlist(my_issues) issue_titles <- my_issues[which(names(my_issues) == "title")] From 5107f2d4726e88db999a19c28af52d25aa432a40 Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 09:24:33 -0500 Subject: [PATCH 80/82] Update script --- scripts/find_issue.R | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 4178fde8e..9661a569b 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -34,19 +34,22 @@ if (!is.character(repo)) { repo <- as.character(repo) } -install.packages('gh', repos='http://cran.us.r-project.org') - -my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", - repo = repo, - .token = git_pat) +# Github api get +result <- httr::GET( + paste0("https://api.github.com/repos/", repo, "/issues"), + httr::add_headers(Authorization = paste0("Bearer ", git_pat)), + httr::accept_json() +) -# Print out the result -write(my_issues, stdout()) +if (httr::status_code(result) != 200) { + httr::stop_for_status(result) +} -my_issues <- unlist(my_issues) -issue_titles <- my_issues[which(names(my_issues) == "title")] +# Process and return results +result_content <- httr::content(result, "text") +result_list <- jsonlite::fromJSON(result_content) -issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) +issue_exists <- length(grep('Broken URLs found in the course!', result_list$title)) # Print out the result -write(length(issue_exists), stdout()) +write(issue_exists, stdout()) From 92a64fa8896484bb31457879a408eee59e7b69e7 Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 09:30:04 -0500 Subject: [PATCH 81/82] Fix logic --- .github/workflows/check-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 9e1c790ea..cc930205d 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -91,7 +91,7 @@ jobs: echo "issue_existence=$issue_exists" >> $GITHUB_OUTPUT - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_existence >= 1}} + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_existence == 0}} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md From 3bf5ac4f0b2e34246f1d6600276ef18f73f46aee Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 09:36:12 -0500 Subject: [PATCH 82/82] fix so runs once a month --- .github/workflows/check-url.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index cc930205d..493ea2bef 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -1,9 +1,9 @@ name: Periodic URL Check on: - pull_request: + workflow_dispatch: schedule: - - cron: '*/2 * * * *' + - cron: '0 0 1 * *' jobs: set-up: