Skip to content

Commit

Permalink
try out reviewdog again
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrell committed Apr 28, 2024
1 parent 9c94f61 commit 8c03987
Showing 1 changed file with 52 additions and 35 deletions.
87 changes: 52 additions & 35 deletions .github/workflows/check-all-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,77 @@ jobs:
# name: Check for Absolute URLs
# runs-on: ubuntu-latest

# check-for-broken-links:
# name: Check for broken links
# remark-lint:
# name: runner / remark-lint
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 18

# - name: Install deps
# run: npm install

# - name: Install remark presets
# run: npm install remark-lint-no-dead-urls

# - name: run remark-cli
# run: |
# npx remark-cli . -qf -e=md,mdx --use=remark-mdx --use remark-frontmatter --use remark-gfm \
# --use 'remark-lint-no-dead-urls=skipLocalhost:true,skipUrlPatterns:["https://www.notion.so/prismaio","https://www.prisma.io/docs","https://dash.cloudflare.com","https://www.cloudflare.com"]'

remark-lint:
name: runner / remark-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: install remark presets
run: npm install remark-gfm remark-mdx remark-frontmatter remark-lint-no-dead-urls
run: npm install remark-lint-no-dead-urls
shell: bash
- name: remark-lint
uses: reviewdog/action-remark-lint@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
remark_args: "-qe=md,mdx --use=remark-gfm --use=remark-mdx --use=remark-frontmatter --use=remark-lint-no-dead-urls"
install_deps: false
remark_args: |
-qf -e=md,mdx --use=remark-mdx --use remark-frontmatter --use remark-gfm \
--use 'remark-lint-no-dead-urls=skipLocalhost:true,skipUrlPatterns:["https://www.notion.so/prismaio","https://www.prisma.io/docs","https://dash.cloudflare.com","https://www.cloudflare.com"]'
check-for-redirects:
name: Check for needed redirects
runs-on: ubuntu-latest
# check-for-redirects:
# name: Check for needed redirects
# runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
# steps:
# - uses: actions/checkout@v4

- name: Create suggested redirects
id: redirects
run: |
bash .github/workflows/scripts/generate-redirects.sh
# - name: Create suggested redirects
# id: redirects
# run: |
# bash .github/workflows/scripts/generate-redirects.sh

- name: Find existing comment
uses: peter-evans/find-comment@v3
id: find-existing-comment-redirect
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: following redirects
# - name: Find existing comment
# uses: peter-evans/find-comment@v3
# id: find-existing-comment-redirect
# with:
# issue-number: ${{ github.event.pull_request.number }}
# comment-author: 'github-actions[bot]'
# body-includes: following redirects

- name: Create comment
if: steps.find-existing-comment-redirect.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.redirects.outputs.body }}
# - name: Create comment
# if: steps.find-existing-comment-redirect.outputs.comment-id == ''
# uses: peter-evans/create-or-update-comment@v4
# with:
# issue-number: ${{ github.event.pull_request.number }}
# body: ${{ steps.redirects.outputs.body }}

- name: Update comment
if: steps.find-existing-comment-redirect.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-existing-comment-redirect.outputs.comment-id }}
body: ${{ steps.redirects.outputs.body }}
edit-mode: replace
# - name: Update comment
# if: steps.find-existing-comment-redirect.outputs.comment-id != ''
# uses: peter-evans/create-or-update-comment@v4
# with:
# comment-id: ${{ steps.find-existing-comment-redirect.outputs.comment-id }}
# body: ${{ steps.redirects.outputs.body }}
# edit-mode: replace

0 comments on commit 8c03987

Please sign in to comment.