From 9fbfaea3a17be2e37b4fc30a8c7aebc78fb60216 Mon Sep 17 00:00:00 2001
From: John SJ Anderson <janders4@fredhutch.org>
Date: Tue, 3 Sep 2024 15:17:01 -0700
Subject: [PATCH] Split `make linkcheck` out into a distinct job [#106]

---
 .github/workflows/docs-ci.yaml | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/docs-ci.yaml b/.github/workflows/docs-ci.yaml
index 89355ef..58509ed 100644
--- a/.github/workflows/docs-ci.yaml
+++ b/.github/workflows/docs-ci.yaml
@@ -39,6 +39,8 @@ on:
         type: string
         default: html
 
+permissions:
+  pull-requests: write
 env:
   # Used for `make` steps.
   # -n: warn on missing references
@@ -68,9 +70,6 @@ jobs:
       - run: make ${{ inputs.make-target }}
         working-directory: ${{ inputs.docs-directory }}
 
-      - run: make linkcheck
-        working-directory: ${{ inputs.docs-directory }}
-
   build-pip:
     if: inputs.pip-install-target != ''
     runs-on: ubuntu-latest
@@ -86,5 +85,17 @@ jobs:
       - run: make ${{ inputs.make-target }}
         working-directory: ${{ inputs.docs-directory }}
 
-      - run: make linkcheck
+  linkcheck:
+    if: inputs.pip-install-target != ''
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          repository: ${{ inputs.repo }}
+
+      - run: pip install '${{ inputs.pip-install-target }}'
+
+      - id: linkcheck
+        run: make linkcheck
         working-directory: ${{ inputs.docs-directory }}
+        continue-on-error: true