From 1232c512266e7b7925f7d9bc2868bdd26d9af03c Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 15 Mar 2024 11:27:44 -0400 Subject: [PATCH 1/4] Update report-maker.yml --- .github/workflows/report-maker.yml | 53 +++++++----------------------- 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/.github/workflows/report-maker.yml b/.github/workflows/report-maker.yml index 18b39f4..32b46b3 100644 --- a/.github/workflows/report-maker.yml +++ b/.github/workflows/report-maker.yml @@ -20,8 +20,10 @@ on: type: string default: ${GITHUB_REF#refs/heads/} jobs: - status-update: + error-check: runs-on: ubuntu-latest + container: + image: jhudsl/base_ottr:main steps: - name: Declare report name @@ -41,19 +43,17 @@ jobs: id: build-components run: | branch_name='preview-${{ github.event.pull_request.number }}' - echo "time=$(date +'%Y-%m-%d-%T')" >> $GITHUB_OUTPUT + echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT echo "commit_id=$GITHUB_SHA" >> $GITHUB_OUTPUT shell: bash - name: Find Comment - uses: peter-evans/find-comment@v3 + uses: peter-evans/find-comment@v2 id: fc with: issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' body-includes: ${{ steps.setup.outputs.error_name }} - direction: first - nth: 1 - name: Status update uses: peter-evans/create-or-update-comment@v2 @@ -65,33 +65,6 @@ jobs: _Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ edit-mode: replace - error-check: - runs-on: ubuntu-latest - container: - image: jhudsl/base_ottr:main - - steps: - - name: Declare report name - id: setup - run: | - if ${{ contains(inputs.check_type, 'spelling') }} ;then - echo "error_name=spelling errors" >> $GITHUB_OUTPUT - echo "ignore_file=resources/dictionary.txt" >> $GITHUB_OUTPUT - elif ${{ contains(inputs.check_type, 'urls') }} ;then - echo "error_name=broken urls" >> $GITHUB_OUTPUT - echo "ignore_file=resources/ignore-urls.txt" >> $GITHUB_OUTPUT - elif ${{ contains(inputs.check_type, 'quiz_format') }} ;then - echo "error_name=quiz formatting errors" >> $GITHUB_OUTPUT - fi - - - name: Build components of the spell check comment - id: build-components - run: | - branch_name='preview-${{ github.event.pull_request.number }}' - echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - echo "commit_id=$GITHUB_SHA" >> $GITHUB_OUTPUT - shell: bash - - name: Checkout uses: actions/checkout@v3 with: @@ -110,21 +83,19 @@ jobs: id: file-path run: | branch_name='preview-${{ github.event.pull_request.number }}' - echo "time=$(date +'%Y-%m-%d-%T')" >> $GITHUB_OUTPUT echo "link_to_ignore_file=https://github.com/${GITHUB_REPOSITORY}/edit/${{ inputs.branch_name }}/${{ steps.setup.outputs.ignore_file }}" >> $GITHUB_OUTPUT + 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 shell: bash - name: Find Comment Again - uses: peter-evans/find-comment@v3 + uses: peter-evans/find-comment@v2 id: fc2 with: issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' - body-includes: ${{ steps.setup.outputs.error_name }}' is currently being re-run' - direction: first - nth: 1 - + body-includes: ${{ steps.setup.outputs.error_name }} + - name: Say check is incomplete if: steps.check_results.outcome == 'failure' uses: peter-evans/create-or-update-comment@v2 @@ -148,9 +119,9 @@ jobs: run: | branch_name='preview-${{ github.event.pull_request.number }}' - git config --global --add safe.directory $GITHUB_WORKSPACE - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git config --system --add safe.directory "$GITHUB_WORKSPACE" + git config --local user.email "itcrtrainingnetwork@gmail.com" + git config --local user.name "jhudsl-robot" git add ${{ steps.check_results.outputs.report_path }} --force || echo "No changes to commit" git commit -m 'Add check file' || echo "No changes to commit" From 4ac5e385f844e09ab71306c8bff4549743d7ad80 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 15 Mar 2024 11:29:35 -0400 Subject: [PATCH 2/4] Restore github actions login tho --- .github/workflows/report-maker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/report-maker.yml b/.github/workflows/report-maker.yml index 32b46b3..0c0ee38 100644 --- a/.github/workflows/report-maker.yml +++ b/.github/workflows/report-maker.yml @@ -119,9 +119,9 @@ jobs: run: | branch_name='preview-${{ github.event.pull_request.number }}' - git config --system --add safe.directory "$GITHUB_WORKSPACE" - git config --local user.email "itcrtrainingnetwork@gmail.com" - git config --local user.name "jhudsl-robot" + git config --global --add safe.directory $GITHUB_WORKSPACE + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add ${{ steps.check_results.outputs.report_path }} --force || echo "No changes to commit" git commit -m 'Add check file' || echo "No changes to commit" From c8b4e39b3cecc686c1db05b0f9723eba1ca07314 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 15 Mar 2024 11:30:15 -0400 Subject: [PATCH 3/4] Apply suggestions from code review --- .github/workflows/report-maker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/report-maker.yml b/.github/workflows/report-maker.yml index 0c0ee38..db8faa5 100644 --- a/.github/workflows/report-maker.yml +++ b/.github/workflows/report-maker.yml @@ -48,7 +48,7 @@ jobs: shell: bash - name: Find Comment - uses: peter-evans/find-comment@v2 + uses: peter-evans/find-comment@v3 id: fc with: issue-number: ${{ github.event.pull_request.number }} @@ -89,7 +89,7 @@ jobs: shell: bash - name: Find Comment Again - uses: peter-evans/find-comment@v2 + uses: peter-evans/find-comment@v3 id: fc2 with: issue-number: ${{ github.event.pull_request.number }} From 78b758c959442ceb1b513adf76dbae2b5108f9be Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 15 Mar 2024 11:31:18 -0400 Subject: [PATCH 4/4] Add time back --- .github/workflows/report-maker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/report-maker.yml b/.github/workflows/report-maker.yml index 0c0ee38..68c86da 100644 --- a/.github/workflows/report-maker.yml +++ b/.github/workflows/report-maker.yml @@ -43,7 +43,7 @@ jobs: id: build-components run: | branch_name='preview-${{ github.event.pull_request.number }}' - echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "time=$(date +'%Y-%m-%d-%T')" >> $GITHUB_OUTPUT echo "commit_id=$GITHUB_SHA" >> $GITHUB_OUTPUT shell: bash @@ -84,7 +84,7 @@ jobs: run: | branch_name='preview-${{ github.event.pull_request.number }}' echo "link_to_ignore_file=https://github.com/${GITHUB_REPOSITORY}/edit/${{ inputs.branch_name }}/${{ steps.setup.outputs.ignore_file }}" >> $GITHUB_OUTPUT - echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + echo "time=$(date +'%Y-%m-%d-%T')" >> $GITHUB_OUTPUT echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/$branch_name/${{ steps.check_results.outputs.report_path }}" >> $GITHUB_OUTPUT shell: bash