Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update report-maker.yml #33

Merged
merged 5 commits into from
Mar 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 12 additions & 41 deletions .github/workflows/report-maker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
cansavvy marked this conversation as resolved.
Show resolved Hide resolved
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
Expand All @@ -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:
Expand All @@ -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
cansavvy marked this conversation as resolved.
Show resolved Hide resolved
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
Expand All @@ -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 "[email protected]"
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"
Expand Down
Loading