Skip to content

Commit

Permalink
Merge pull request #452 from owasp-noir/enhance-deadlinks-workflow
Browse files Browse the repository at this point in the history
Enhance deadlinks workflow
  • Loading branch information
hahwul authored Nov 8, 2024
2 parents d1dc540 + 65ea3f9 commit 6483620
Showing 1 changed file with 44 additions and 29 deletions.
73 changes: 44 additions & 29 deletions .github/workflows/deadlinks.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
---
name: DeadLink
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Find Broken Link
uses: hahwul/deadfinder@1.4.4
id: broken-link
with:
command: sitemap
target: https://owasp-noir.github.io/noir/sitemap.xml
- name: Create an issue
uses: dacbd/create-issue-action@main
with:
token: ${{ github.token }}
title: DeadLink Issue
body: |
```json
${{ steps.broken-link.outputs.output }}
```
name: DeadLink
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Find Broken Link
uses: hahwul/deadfinder@1.5.0
id: broken-link
with:
command: sitemap
target: https://owasp-noir.github.io/noir/sitemap.xml

- name: Create Markdown Table from JSON
id: create-markdown-table
run: |
echo "## DeadLink Report" > deadlink_report.md
echo "" >> deadlink_report.md
echo "| Target URL | Deadlink |" >> deadlink_report.md
echo "|------------|------------|" >> deadlink_report.md
echo '${{ steps.broken-link.outputs.output }}' | jq -r 'to_entries[] | .key as $k | .value[] | "| \($k) | \(.) |"' >> deadlink_report.md
- name: Read Markdown Table from File
id: read-markdown-table
run: |
table_content=$(cat deadlink_report.md)
echo "TABLE_CONTENT<<EOF" >> $GITHUB_ENV
echo "$table_content" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create an issue
uses: dacbd/create-issue-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: DeadLink Issue
body: ${{ env.TABLE_CONTENT }}

0 comments on commit 6483620

Please sign in to comment.