Skip to content

Commit

Permalink
Merge pull request #25 from SSWConsulting/create-issue-if-scan-fails
Browse files Browse the repository at this point in the history
Added step to send API creating new issue if scan fails
  • Loading branch information
tombui99 committed May 2, 2024
2 parents 21fb556 + 0014c09 commit 76b4e21
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ runs:
inputs=($INPUTS)
- name: "SSW CodeAuditor - Check broken links and performance"
shell: bash
continue-on-error: true
run: |
docker run sswconsulting/codeauditor --token ${{inputs.token}} --url ${{inputs.url}}
- name: "Check if new broken links/code errors/code warnings has come up"
Expand Down Expand Up @@ -155,3 +154,11 @@ runs:
echo "| **Broken Links** | ${{fromJson(steps.summaries.outputs.summariesOut).summary[0].totalUnique404}} |" >> $GITHUB_STEP_SUMMARY
echo "| **HTML Errors** | ${{fromJson(steps.summaries.outputs.summariesOut).summary[0].htmlErrors}} |" >> $GITHUB_STEP_SUMMARY
echo "| **HTML Warnings** | ${{fromJson(steps.summaries.outputs.summariesOut).summary[0].htmlWarnings}} |" >> $GITHUB_STEP_SUMMARY
- name: "Send issue report if scan fails"
shell: bash
if: ${{ failure() }}
run: |
curl \
-X POST 'https://asia-east2-sswlinkauditor-c1131.cloudfunctions.net/api/createReportIssue' \
-H 'Content-Type: application/json' \
-d "{\"url\": \"${{ inputs.url }}\", \"dateReported\": \"$(date +'%Y-%m-%d %H:%M:%S')\", \"repository\": \"${{ github.repository }}\", \"triggeringActor\": \"${{ github.actor }}\", \"repository_owner\": \"${{ github.repository_owner }}\", \"CodeAuditorToken\": \"${{ inputs.token }}\", \"workflowURL\": \"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"

0 comments on commit 76b4e21

Please sign in to comment.