From 80ff31e5c21de8cbc062794cdee71a4cc25f1f05 Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Mon, 13 Jan 2025 22:00:49 -0800 Subject: [PATCH 01/58] new branch with recent main changes --- .../workflows/check-links-and-spelling.yml | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 .github/workflows/check-links-and-spelling.yml diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml new file mode 100644 index 0000000..c5c7083 --- /dev/null +++ b/.github/workflows/check-links-and-spelling.yml @@ -0,0 +1,174 @@ +############################################################################### +# Introduction: +# ------------- +# This workflow builds the NMDC documentation, checks for broken links, +# and identifies any spelling errors in the documentation. +# If any issues are found (broken links or misspelled words), it creates +# GitHub Issues containing lists of the errors for further review and fixing. +# +############################################################################### + + + +name: Check Links and Spelling + +on: + push: { branches: [ 61-add-link-checker ] } + workflow_dispatch: { } + workflow_call: { } + +jobs: + + compile-home-docs: + name: Compile home docs + uses: ./.github/workflows/compile-home-docs.yml + fetch-and-compile-runtime-docs: + name: Fetch and compile Runtime docs + uses: ./.github/workflows/fetch-and-compile-runtime-docs.yml + fetch-and-compile-workflow-docs: + name: Fetch and compile workflow docs + uses: ./.github/workflows/fetch-and-compile-workflow-docs.yml + + build: + name: Compile main website + # This job depends upon other jobs succeeding. + # Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds + needs: + - compile-home-docs + - fetch-and-compile-runtime-docs + - fetch-and-compile-workflow-docs + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Check out commit # Docs: https://github.com/actions/checkout + uses: actions/checkout@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 # Docs: https://github.com/actions/download-artifact + with: + path: artifacts + # Note: We use the `-T` option of the `cp` command so that the source directory name does not + # get appended to the destination directory name. It's short for `--no-target-directory`. + # Reference: https://www.gnu.org/software/coreutils/manual/html_node/Target-directory.html + - name: Assemble website file tree + run: | + mkdir -p \ + _build/html/runtime \ + _build/html/workflows + cp -R -T artifacts/home-docs-as-html _build/html + cp -R -T artifacts/runtime-docs-as-html _build/html/runtime + cp -R -T artifacts/workflow-docs-as-html _build/html/workflows + - name: Inject robots.txt file into assembled website file tree + run: | + cp content/robots.txt _build/html/robots.txt + ls -R _build/html + - name: Save the result for publishing to GitHub Pages # Docs: https://github.com/actions/upload-pages-artifact + uses: actions/upload-pages-artifact@v3 + with: + path: _build/html + + + check-links: + name: Check Links in Documentation + needs: build + runs-on: ubuntu-latest + steps: + - name: Check out commit # Docs: https://github.com/actions/checkout + uses: actions/checkout@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 # Docs: https://github.com/actions/download-artifact + with: + path: artifacts + - name: Run Markdown Link Check + uses: gaurav-nelson/github-action-markdown-link-check@v1 + id: linkcheck + with: + use-quiet-mode: 'yes' + folder-path: 'artifacts/' + max-depth: -1 + file-extension: '.html' + + - name: Create GitHub Issue for Broken Links + if: ${{ steps.linkcheck.outputs.found_errors == 'true' }} + uses: peter-evans/create-issue-from-file@v4 + with: + title: Documentation contains misspelled words + content-filepath: './linkcheck_report.txt' + labels: documentation, broken-link + + + # ------------------ Spell Checking ------------------ + check-spelling: + name: Check Spelling in Documentation + needs: build + runs-on: ubuntu-latest + steps: + - name: Check out commit # Docs: https://github.com/actions/checkout + uses: actions/checkout@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 # Docs: https://github.com/actions/download-artifact + with: + path: artifacts + - name: Run Spell Checker + id: spellcheck + uses: wow-actions/spell-checker@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + include: | + ls + artifacts/**/*.html + artifacts/**/*.md + artifacts/**/*.txt + + - name: Create GitHub Issue for Misspellings + if: ${{ steps.spellcheck.outputs.found_errors == 'true' }} + uses: peter-evans/create-issue-from-file@v4 + with: + title: Documentation contains misspelled words + content-filepath: './spellcheck_report.txt' + labels: documentation, spelling-error + + # ------------------ Link Checking ------------------ + # - name: Hyperlink link checker + # uses: untitaker/hyperlink@0.1.43 + # id: linkcheck + # with: + # args: _build/html/ --check-anchors --continue + + # - name: Create GitHub Issue listing broken links + # if: ${{ success() && steps.linkcheck.outputs.broken-links != '' }} + # uses: peter-evans/create-issue-from-file@v4 + # with: + # title: Documentation contains broken links + # content-filepath: './linkcheck_report.txt' + # labels: documentation, broken-link + + # - name: Use Lychee to check for broken links + # # This step will populate `env.lychee_exit_code` with the exit code returned by lychee. + # # Possible exit codes: https://github.com/lycheeverse/lychee?tab=readme-ov-file#exit-codes + # # Reference: https://github.com/lycheeverse/lychee-action + # id: lychee + # uses: lycheeverse/lychee-action@v1.9.0 + # with: + # # Reference: https://github.com/lycheeverse/lychee#commandline-parameters + # args: --base . --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst' + # debug: true + # output: ./lychee/out.md + # fail: false + # - name: Create GitHub Issue listing broken links + # # This step will only run if lychee returned a non-zero exit code. + # # Reference: https://docs.github.com/en/actions/learn-github-actions/variables#using-the-env-context-to-access-environment-variable-values + # if: ${{ env.lychee_exit_code != 0 }} + # uses: peter-evans/create-issue-from-file@v4 + # with: + # title: Markdown docs contain broken links + # content-filepath: ./lychee/out.md + # labels: documentation, broken-link + + # - uses: actions/checkout@v4 + # - name: Run linkspector + # uses: UmbrellaDocs/action-linkspector@v1.2.4 + # with: + # github_token: ${{ secrets.github_token }} + # reporter: github-pr-review + # fail_on_error: false From c31dff9330dc5fe5f1b1f1269c0fff5e882f8532 Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Tue, 14 Jan 2025 18:05:44 -0800 Subject: [PATCH 02/58] trying a different spell checker --- .../workflows/check-links-and-spelling.yml | 55 +++++++++++++------ .github/workflows/dictionary.txt | 2 + .github/workflows/mlc_config.json | 7 +++ 3 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/dictionary.txt create mode 100644 .github/workflows/mlc_config.json diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index c5c7083..33db025 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -17,6 +17,10 @@ on: workflow_dispatch: { } workflow_call: { } +env: + JSON_FILE: spell-check.json + DICTIONARY_FILE: .github/workflows/dictionary.txt + jobs: compile-home-docs: @@ -84,19 +88,32 @@ jobs: id: linkcheck with: use-quiet-mode: 'yes' + use-verbose-mode: 'no' folder-path: 'artifacts/' max-depth: -1 file-extension: '.html' - + base-branch: 'main' + - name: Save Link Check Output + run: | + mkdir -p linkcheck_reports + # Save the output to a file + echo "${{ steps.linkcheck.outputs.result }}" > linkcheck_reports/linkcheck_output.txt + - name: Analyze Link Check Results + id: analyze-linkcheck + run: | + if grep -q "ERROR" linkcheck_reports/linkcheck_output.txt; then + echo "found_errors=true" >> $GITHUB_ENV + else + echo "found_errors=false" >> $GITHUB_ENV + fi - name: Create GitHub Issue for Broken Links - if: ${{ steps.linkcheck.outputs.found_errors == 'true' }} + if: env.found_errors == 'true' uses: peter-evans/create-issue-from-file@v4 with: - title: Documentation contains misspelled words - content-filepath: './linkcheck_report.txt' + title: "Broken links detected in documentation" + content-filepath: 'linkcheck_reports/linkcheck_output.txt' labels: documentation, broken-link - # ------------------ Spell Checking ------------------ check-spelling: name: Check Spelling in Documentation @@ -110,22 +127,28 @@ jobs: with: path: artifacts - name: Run Spell Checker - id: spellcheck - uses: wow-actions/spell-checker@v1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - include: | - ls - artifacts/**/*.html - artifacts/**/*.md - artifacts/**/*.txt + id: spellchecker-cli + # uses: tbroadley/spellchecker-cli-action@v1 + # with: + # files: "**/*.html" + # language: "en-US" + # quiet: true + # reports: true + # plugins: "spell indefinite-article repeated-words syntax-mentions syntax-urls" + continue-on-error: true + run: | + npx -y spellchecker-cli --files artifacts/**/*.html \ + --dictionaries $DICTIONARY_FILE \ + --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ + --reports $JSON_FILE + - name: Create GitHub Issue for Misspellings - if: ${{ steps.spellcheck.outputs.found_errors == 'true' }} + if: ${{ steps.spellchecker-cli.conclusion == 'success' }} uses: peter-evans/create-issue-from-file@v4 with: title: Documentation contains misspelled words - content-filepath: './spellcheck_report.txt' + content-filepath: $JSON_FILE labels: documentation, spelling-error # ------------------ Link Checking ------------------ diff --git a/.github/workflows/dictionary.txt b/.github/workflows/dictionary.txt new file mode 100644 index 0000000..d1c7cd0 --- /dev/null +++ b/.github/workflows/dictionary.txt @@ -0,0 +1,2 @@ +NMDC +NMDC EDGE diff --git a/.github/workflows/mlc_config.json b/.github/workflows/mlc_config.json new file mode 100644 index 0000000..92bb6c1 --- /dev/null +++ b/.github/workflows/mlc_config.json @@ -0,0 +1,7 @@ +{ + "timeout": "20s", + "retryOn429": true, + "retryCount": 5, + "fallbackRetryDelay": "30s", + "aliveStatusCodes": [200, 206] + } \ No newline at end of file From f1a84f31fc4a097b7d7c77dc99f48c352e2f05ce Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Tue, 14 Jan 2025 18:16:48 -0800 Subject: [PATCH 03/58] fix syntax error --- .../workflows/check-links-and-spelling.yml | 52 +------------------ 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 33db025..99d4e1e 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -22,7 +22,6 @@ env: DICTIONARY_FILE: .github/workflows/dictionary.txt jobs: - compile-home-docs: name: Compile home docs uses: ./.github/workflows/compile-home-docs.yml @@ -35,8 +34,6 @@ jobs: build: name: Compile main website - # This job depends upon other jobs succeeding. - # Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds needs: - compile-home-docs - fetch-and-compile-runtime-docs @@ -71,7 +68,6 @@ jobs: with: path: _build/html - check-links: name: Check Links in Documentation needs: build @@ -93,7 +89,7 @@ jobs: max-depth: -1 file-extension: '.html' base-branch: 'main' - - name: Save Link Check Output + - name: Save Link Check Output run: | mkdir -p linkcheck_reports # Save the output to a file @@ -142,7 +138,6 @@ jobs: --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ --reports $JSON_FILE - - name: Create GitHub Issue for Misspellings if: ${{ steps.spellchecker-cli.conclusion == 'success' }} uses: peter-evans/create-issue-from-file@v4 @@ -151,47 +146,4 @@ jobs: content-filepath: $JSON_FILE labels: documentation, spelling-error - # ------------------ Link Checking ------------------ - # - name: Hyperlink link checker - # uses: untitaker/hyperlink@0.1.43 - # id: linkcheck - # with: - # args: _build/html/ --check-anchors --continue - - # - name: Create GitHub Issue listing broken links - # if: ${{ success() && steps.linkcheck.outputs.broken-links != '' }} - # uses: peter-evans/create-issue-from-file@v4 - # with: - # title: Documentation contains broken links - # content-filepath: './linkcheck_report.txt' - # labels: documentation, broken-link - - # - name: Use Lychee to check for broken links - # # This step will populate `env.lychee_exit_code` with the exit code returned by lychee. - # # Possible exit codes: https://github.com/lycheeverse/lychee?tab=readme-ov-file#exit-codes - # # Reference: https://github.com/lycheeverse/lychee-action - # id: lychee - # uses: lycheeverse/lychee-action@v1.9.0 - # with: - # # Reference: https://github.com/lycheeverse/lychee#commandline-parameters - # args: --base . --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst' - # debug: true - # output: ./lychee/out.md - # fail: false - # - name: Create GitHub Issue listing broken links - # # This step will only run if lychee returned a non-zero exit code. - # # Reference: https://docs.github.com/en/actions/learn-github-actions/variables#using-the-env-context-to-access-environment-variable-values - # if: ${{ env.lychee_exit_code != 0 }} - # uses: peter-evans/create-issue-from-file@v4 - # with: - # title: Markdown docs contain broken links - # content-filepath: ./lychee/out.md - # labels: documentation, broken-link - - # - uses: actions/checkout@v4 - # - name: Run linkspector - # uses: UmbrellaDocs/action-linkspector@v1.2.4 - # with: - # github_token: ${{ secrets.github_token }} - # reporter: github-pr-review - # fail_on_error: false + \ No newline at end of file From 618082e85d0f3724ac7306e75722296c630ed535 Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Tue, 14 Jan 2025 22:11:33 -0800 Subject: [PATCH 04/58] update dictionary and json path --- .../workflows/check-links-and-spelling.yml | 6 +++--- .github/workflows/dictionary.txt | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 99d4e1e..d168335 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -82,6 +82,7 @@ jobs: - name: Run Markdown Link Check uses: gaurav-nelson/github-action-markdown-link-check@v1 id: linkcheck + continue-on-error: true with: use-quiet-mode: 'yes' use-verbose-mode: 'no' @@ -91,8 +92,7 @@ jobs: base-branch: 'main' - name: Save Link Check Output run: | - mkdir -p linkcheck_reports - # Save the output to a file + mkdir -p linkcheck_reports echo "${{ steps.linkcheck.outputs.result }}" > linkcheck_reports/linkcheck_output.txt - name: Analyze Link Check Results id: analyze-linkcheck @@ -143,7 +143,7 @@ jobs: uses: peter-evans/create-issue-from-file@v4 with: title: Documentation contains misspelled words - content-filepath: $JSON_FILE + content-filepath: env.JSON_FILE labels: documentation, spelling-error \ No newline at end of file diff --git a/.github/workflows/dictionary.txt b/.github/workflows/dictionary.txt index d1c7cd0..d9e7b58 100644 --- a/.github/workflows/dictionary.txt +++ b/.github/workflows/dictionary.txt @@ -1,2 +1,22 @@ NMDC +NMDC's NMDC EDGE +Microbiome +biosample +multi-omics +Mgt. +nmdc-runtime +Diátaxis +JSON +changesheets +MkDocs +Metagenomic +Metagenome +MetaG +Metatranscriptome +Metatranscriptomic +MetaT +Metaproteomic +Metabolomics +Lipidomics +IMG \ No newline at end of file From 94e93e74f47beeb5637a45a130d036b96cbfac8b Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Tue, 14 Jan 2025 22:30:54 -0800 Subject: [PATCH 05/58] update dictionary and remove env vars --- .../workflows/check-links-and-spelling.yml | 18 ++------ .github/workflows/dictionary.txt | 46 ++++++++++++------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index d168335..ef993df 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -17,10 +17,6 @@ on: workflow_dispatch: { } workflow_call: { } -env: - JSON_FILE: spell-check.json - DICTIONARY_FILE: .github/workflows/dictionary.txt - jobs: compile-home-docs: name: Compile home docs @@ -124,26 +120,20 @@ jobs: path: artifacts - name: Run Spell Checker id: spellchecker-cli - # uses: tbroadley/spellchecker-cli-action@v1 - # with: - # files: "**/*.html" - # language: "en-US" - # quiet: true - # reports: true - # plugins: "spell indefinite-article repeated-words syntax-mentions syntax-urls" continue-on-error: true run: | + mkdir -p spellcheck_reports npx -y spellchecker-cli --files artifacts/**/*.html \ - --dictionaries $DICTIONARY_FILE \ + --dictionaries .github/workflows/dictionary.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports $JSON_FILE + --reports spellcheck_reports/spellcheck_output.txt - name: Create GitHub Issue for Misspellings if: ${{ steps.spellchecker-cli.conclusion == 'success' }} uses: peter-evans/create-issue-from-file@v4 with: title: Documentation contains misspelled words - content-filepath: env.JSON_FILE + content-filepath: 'spellcheck_reports/spellcheck_output.txt' labels: documentation, spelling-error \ No newline at end of file diff --git a/.github/workflows/dictionary.txt b/.github/workflows/dictionary.txt index d9e7b58..981ff7c 100644 --- a/.github/workflows/dictionary.txt +++ b/.github/workflows/dictionary.txt @@ -1,22 +1,34 @@ -NMDC -NMDC's -NMDC EDGE -Microbiome +Bioinformatics +bioinformatics +Biosample biosample -multi-omics -Mgt. -nmdc-runtime -Diátaxis -JSON +Changesheets changesheets -MkDocs -Metagenomic -Metagenome +Diátaxis +Globus +IMG +JSON +json +Lipidomics +lipidomics +Metabolomics +metabolomics MetaG +Metagenome +metagenome +Metagenomic +metagenomic +Metaproteomic +MetaT Metatranscriptome +metatranscriptome Metatranscriptomic -MetaT -Metaproteomic -Metabolomics -Lipidomics -IMG \ No newline at end of file +metatranscriptomic +Microbiome +microbiome +Mgt +MkDocs +multi-omics +NMDC +NMDC's +nmdc-runtime \ No newline at end of file From e1482429ccf41941b4d52a2a975fd995b0e66474 Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Tue, 14 Jan 2025 23:29:41 -0800 Subject: [PATCH 06/58] testing with import --- .../workflows/check-links-and-spelling.yml | 92 +++++-------------- .github/workflows/deploy-to-gh-pages.yml | 40 ++++---- 2 files changed, 46 insertions(+), 86 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index ef993df..0cec18a 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -18,61 +18,15 @@ on: workflow_call: { } jobs: - compile-home-docs: - name: Compile home docs - uses: ./.github/workflows/compile-home-docs.yml - fetch-and-compile-runtime-docs: - name: Fetch and compile Runtime docs - uses: ./.github/workflows/fetch-and-compile-runtime-docs.yml - fetch-and-compile-workflow-docs: - name: Fetch and compile workflow docs - uses: ./.github/workflows/fetch-and-compile-workflow-docs.yml - - build: - name: Compile main website - needs: - - compile-home-docs - - fetch-and-compile-runtime-docs - - fetch-and-compile-workflow-docs - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - name: Check out commit # Docs: https://github.com/actions/checkout - uses: actions/checkout@v4 - - name: Download all artifacts - uses: actions/download-artifact@v4 # Docs: https://github.com/actions/download-artifact - with: - path: artifacts - # Note: We use the `-T` option of the `cp` command so that the source directory name does not - # get appended to the destination directory name. It's short for `--no-target-directory`. - # Reference: https://www.gnu.org/software/coreutils/manual/html_node/Target-directory.html - - name: Assemble website file tree - run: | - mkdir -p \ - _build/html/runtime \ - _build/html/workflows - cp -R -T artifacts/home-docs-as-html _build/html - cp -R -T artifacts/runtime-docs-as-html _build/html/runtime - cp -R -T artifacts/workflow-docs-as-html _build/html/workflows - - name: Inject robots.txt file into assembled website file tree - run: | - cp content/robots.txt _build/html/robots.txt - ls -R _build/html - - name: Save the result for publishing to GitHub Pages # Docs: https://github.com/actions/upload-pages-artifact - uses: actions/upload-pages-artifact@v3 - with: - path: _build/html - check-links: name: Check Links in Documentation needs: build runs-on: ubuntu-latest steps: - - name: Check out commit # Docs: https://github.com/actions/checkout + - name: Check out commit uses: actions/checkout@v4 - name: Download all artifacts - uses: actions/download-artifact@v4 # Docs: https://github.com/actions/download-artifact + uses: actions/download-artifact@v4 with: path: artifacts - name: Run Markdown Link Check @@ -80,30 +34,25 @@ jobs: id: linkcheck continue-on-error: true with: - use-quiet-mode: 'yes' - use-verbose-mode: 'no' + use-quiet-mode: yes + use-verbose-mode: no folder-path: 'artifacts/' max-depth: -1 - file-extension: '.html' - base-branch: 'main' + file-extension: .html + base-branch: main + output: linkcheck_output.txt - name: Save Link Check Output run: | mkdir -p linkcheck_reports echo "${{ steps.linkcheck.outputs.result }}" > linkcheck_reports/linkcheck_output.txt - - name: Analyze Link Check Results - id: analyze-linkcheck - run: | - if grep -q "ERROR" linkcheck_reports/linkcheck_output.txt; then - echo "found_errors=true" >> $GITHUB_ENV - else - echo "found_errors=false" >> $GITHUB_ENV - fi + ls + ls linkcheck_reports - name: Create GitHub Issue for Broken Links - if: env.found_errors == 'true' + if: ${{ steps.linkcheck.outcome != 'success' }} uses: peter-evans/create-issue-from-file@v4 with: - title: "Broken links detected in documentation" - content-filepath: 'linkcheck_reports/linkcheck_output.txt' + title: Broken links detected in documentation + content-filepath: linkcheck_reports/linkcheck_output.txt labels: documentation, broken-link # ------------------ Spell Checking ------------------ @@ -122,18 +71,25 @@ jobs: id: spellchecker-cli continue-on-error: true run: | - mkdir -p spellcheck_reports + mkdir -p spellcheck_reports npx -y spellchecker-cli --files artifacts/**/*.html \ --dictionaries .github/workflows/dictionary.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports spellcheck_reports/spellcheck_output.txt - + --reports spellcheck_reports/spellcheck_report.json \ + > spellcheck_reports/spellcheck_output.txt + ls + ls spellcheck_reports/ + # - name: Upload Spell Check Artifacts + # uses: actions/upload-artifact@v3 + # if: ${{ steps.spellchecker-cli.outcome == 'success' }} + # with: + # path: spellcheck_reports - name: Create GitHub Issue for Misspellings - if: ${{ steps.spellchecker-cli.conclusion == 'success' }} + if: ${{ steps.spellchecker-cli.outcome == 'success' }} uses: peter-evans/create-issue-from-file@v4 with: title: Documentation contains misspelled words - content-filepath: 'spellcheck_reports/spellcheck_output.txt' + content-filepath: spellcheck_reports/spellcheck_output.txt labels: documentation, spelling-error \ No newline at end of file diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml index 318223e..d9b399b 100644 --- a/.github/workflows/deploy-to-gh-pages.yml +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -3,7 +3,7 @@ name: Build and deploy to GitHub Pages on: - push: { branches: [ main ] } + push: { branches: [ 61-add-link-checker ] } workflow_dispatch: { } # Reference: https://docs.github.com/en/actions/using-jobs/using-concurrency @@ -62,20 +62,24 @@ jobs: with: path: _build/html - deploy: - name: Deploy website - needs: - - build - runs-on: ubuntu-latest - # Reference: https://github.com/actions/deploy-pages - permissions: - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - # Reference: https://github.com/actions/deploy-pages - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + check-links-and-spelling: + name: Check Links and Spelling + uses: ./.github/workflows/check-links-and-spelling.yml + + # deploy: + # name: Deploy website + # needs: + # - build + # runs-on: ubuntu-latest + # # Reference: https://github.com/actions/deploy-pages + # permissions: + # pages: write + # id-token: write + # environment: + # name: github-pages + # url: ${{ steps.deployment.outputs.page_url }} + # steps: + # # Reference: https://github.com/actions/deploy-pages + # - name: Deploy to GitHub Pages + # id: deployment + # uses: actions/deploy-pages@v4 From 349cf26468714f4d44e5421d1bacba0ee54fa025 Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Tue, 14 Jan 2025 23:37:36 -0800 Subject: [PATCH 07/58] split yml into two --- .../workflows/check-links-and-spelling.yml | 95 ------------------- .github/workflows/check-links.yml | 44 +++++++++ .github/workflows/check-spelling.yml | 43 +++++++++ .github/workflows/deploy-to-gh-pages.yml | 9 +- 4 files changed, 93 insertions(+), 98 deletions(-) delete mode 100644 .github/workflows/check-links-and-spelling.yml create mode 100644 .github/workflows/check-links.yml create mode 100644 .github/workflows/check-spelling.yml diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml deleted file mode 100644 index 0cec18a..0000000 --- a/.github/workflows/check-links-and-spelling.yml +++ /dev/null @@ -1,95 +0,0 @@ -############################################################################### -# Introduction: -# ------------- -# This workflow builds the NMDC documentation, checks for broken links, -# and identifies any spelling errors in the documentation. -# If any issues are found (broken links or misspelled words), it creates -# GitHub Issues containing lists of the errors for further review and fixing. -# -############################################################################### - - - -name: Check Links and Spelling - -on: - push: { branches: [ 61-add-link-checker ] } - workflow_dispatch: { } - workflow_call: { } - -jobs: - check-links: - name: Check Links in Documentation - needs: build - runs-on: ubuntu-latest - steps: - - name: Check out commit - uses: actions/checkout@v4 - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - name: Run Markdown Link Check - uses: gaurav-nelson/github-action-markdown-link-check@v1 - id: linkcheck - continue-on-error: true - with: - use-quiet-mode: yes - use-verbose-mode: no - folder-path: 'artifacts/' - max-depth: -1 - file-extension: .html - base-branch: main - output: linkcheck_output.txt - - name: Save Link Check Output - run: | - mkdir -p linkcheck_reports - echo "${{ steps.linkcheck.outputs.result }}" > linkcheck_reports/linkcheck_output.txt - ls - ls linkcheck_reports - - name: Create GitHub Issue for Broken Links - if: ${{ steps.linkcheck.outcome != 'success' }} - uses: peter-evans/create-issue-from-file@v4 - with: - title: Broken links detected in documentation - content-filepath: linkcheck_reports/linkcheck_output.txt - labels: documentation, broken-link - - # ------------------ Spell Checking ------------------ - check-spelling: - name: Check Spelling in Documentation - needs: build - runs-on: ubuntu-latest - steps: - - name: Check out commit # Docs: https://github.com/actions/checkout - uses: actions/checkout@v4 - - name: Download all artifacts - uses: actions/download-artifact@v4 # Docs: https://github.com/actions/download-artifact - with: - path: artifacts - - name: Run Spell Checker - id: spellchecker-cli - continue-on-error: true - run: | - mkdir -p spellcheck_reports - npx -y spellchecker-cli --files artifacts/**/*.html \ - --dictionaries .github/workflows/dictionary.txt \ - --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports spellcheck_reports/spellcheck_report.json \ - > spellcheck_reports/spellcheck_output.txt - ls - ls spellcheck_reports/ - # - name: Upload Spell Check Artifacts - # uses: actions/upload-artifact@v3 - # if: ${{ steps.spellchecker-cli.outcome == 'success' }} - # with: - # path: spellcheck_reports - - name: Create GitHub Issue for Misspellings - if: ${{ steps.spellchecker-cli.outcome == 'success' }} - uses: peter-evans/create-issue-from-file@v4 - with: - title: Documentation contains misspelled words - content-filepath: spellcheck_reports/spellcheck_output.txt - labels: documentation, spelling-error - - \ No newline at end of file diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml new file mode 100644 index 0000000..924f339 --- /dev/null +++ b/.github/workflows/check-links.yml @@ -0,0 +1,44 @@ +name: Check Links + +on: + push: { branches: [ main ] } + workflow_dispatch: { } + workflow_call: { } + +jobs: + check-links: + name: Check Links in Documentation + needs: build + runs-on: ubuntu-latest + steps: + - name: Check out commit + uses: actions/checkout@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + - name: Run Markdown Link Check + uses: gaurav-nelson/github-action-markdown-link-check@v1 + id: linkcheck + continue-on-error: true + with: + use-quiet-mode: yes + use-verbose-mode: no + folder-path: 'artifacts/' + max-depth: -1 + file-extension: .html + base-branch: main + output: linkcheck_output.txt + - name: Save Link Check Output + run: | + mkdir -p linkcheck_reports + echo "${{ steps.linkcheck.outputs.result }}" > linkcheck_reports/linkcheck_output.txt + ls + ls linkcheck_reports + - name: Create GitHub Issue for Broken Links + if: ${{ steps.linkcheck.outcome != 'success' }} + uses: peter-evans/create-issue-from-file@v4 + with: + title: Broken links detected in documentation + content-filepath: linkcheck_reports/linkcheck_output.txt + labels: documentation, broken-link \ No newline at end of file diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml new file mode 100644 index 0000000..707e154 --- /dev/null +++ b/.github/workflows/check-spelling.yml @@ -0,0 +1,43 @@ +name: Check Spelling + +on: + push: { branches: [ main ] } + workflow_dispatch: { } + workflow_call: { } + +jobs: + check-spelling: + name: Check Spelling in Documentation + needs: build + runs-on: ubuntu-latest + steps: + - name: Check out commit # Docs: https://github.com/actions/checkout + uses: actions/checkout@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 # Docs: https://github.com/actions/download-artifact + with: + path: artifacts + - name: Run Spell Checker + id: spellchecker-cli + continue-on-error: true + run: | + mkdir -p spellcheck_reports + npx -y spellchecker-cli --files artifacts/**/*.html \ + --dictionaries .github/workflows/dictionary.txt \ + --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ + --reports spellcheck_reports/spellcheck_report.json \ + > spellcheck_reports/spellcheck_output.txt + ls + ls spellcheck_reports/ + # - name: Upload Spell Check Artifacts + # uses: actions/upload-artifact@v3 + # if: ${{ steps.spellchecker-cli.outcome == 'success' }} + # with: + # path: spellcheck_reports + - name: Create GitHub Issue for Misspellings + if: ${{ steps.spellchecker-cli.outcome == 'success' }} + uses: peter-evans/create-issue-from-file@v4 + with: + title: Documentation contains misspelled words + content-filepath: spellcheck_reports/spellcheck_output.txt + labels: documentation, spelling-error \ No newline at end of file diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml index d9b399b..929a3af 100644 --- a/.github/workflows/deploy-to-gh-pages.yml +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -62,9 +62,12 @@ jobs: with: path: _build/html - check-links-and-spelling: - name: Check Links and Spelling - uses: ./.github/workflows/check-links-and-spelling.yml + check-links: + name: Check Links + uses: ./.github/workflows/check-links.yml + check-spelling: + name: Check Spelling + uses: ./.github/workflows/check-spelling.yml # deploy: # name: Deploy website From 762fa5d7ddde01165bd90fae023bd83c2542fbe9 Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Tue, 14 Jan 2025 23:39:57 -0800 Subject: [PATCH 08/58] remove the need build --- .github/workflows/check-links.yml | 1 - .github/workflows/check-spelling.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 924f339..f103891 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -8,7 +8,6 @@ on: jobs: check-links: name: Check Links in Documentation - needs: build runs-on: ubuntu-latest steps: - name: Check out commit diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index 707e154..cc2014a 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -8,7 +8,6 @@ on: jobs: check-spelling: name: Check Spelling in Documentation - needs: build runs-on: ubuntu-latest steps: - name: Check out commit # Docs: https://github.com/actions/checkout From 7f30a3a0445ec0c07ac99c9da345dcdd9abfab7f Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Tue, 14 Jan 2025 23:54:10 -0800 Subject: [PATCH 09/58] recombined files, changed call order --- .../workflows/check-links-and-spelling.yml | 79 +++++++++++++++++++ .github/workflows/check-links.yml | 43 ---------- .github/workflows/check-spelling.yml | 42 ---------- .github/workflows/deploy-to-gh-pages.yml | 11 ++- 4 files changed, 84 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/check-links-and-spelling.yml delete mode 100644 .github/workflows/check-links.yml delete mode 100644 .github/workflows/check-spelling.yml diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml new file mode 100644 index 0000000..7dce330 --- /dev/null +++ b/.github/workflows/check-links-and-spelling.yml @@ -0,0 +1,79 @@ +############################################################################### +# Introduction: +# ------------- +# This workflow builds the NMDC documentation, checks for broken links, +# and identifies any spelling errors in the documentation. +# If any issues are found (broken links or misspelled words), it creates +# GitHub Issues containing lists of the errors for further review and fixing. +# +############################################################################### + +name: Check Links and Spelling in Documentation + +on: + push: { branches: [ main ] } + workflow_dispatch: { } + workflow_call: { } + +jobs: + check-links: + name: Check Links in Documentation + runs-on: ubuntu-latest + steps: + - name: Check out commit + uses: actions/checkout@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + - name: Run Markdown Link Check + uses: gaurav-nelson/github-action-markdown-link-check@v1 + id: linkcheck + continue-on-error: true + with: + use-quiet-mode: yes + use-verbose-mode: no + folder-path: artifacts + max-depth: -1 + file-extension: .html + base-branch: main + output: linkcheck_output.txt + - name: Save Link Check Output + run: | + mkdir -p linkcheck_reports + echo "${{ steps.linkcheck.outputs.result }}" > linkcheck_reports/linkcheck_output.txt + - name: Create GitHub Issue for Broken Links + if: ${{ steps.linkcheck.outcome != 'success' }} + uses: peter-evans/create-issue-from-file@v4 + with: + title: Broken links detected in documentation + content-filepath: linkcheck_reports/linkcheck_output.txt + labels: documentation, broken-link + + check-spelling: + name: Check Spelling in Documentation + runs-on: ubuntu-latest + steps: + - name: Check out commit + uses: actions/checkout@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + - name: Run Spell Checker + id: spellchecker-cli + continue-on-error: true + run: | + mkdir -p spellcheck_reports + npx -y spellchecker-cli --files artifacts/**/*.html \ + --dictionaries .github/workflows/dictionary.txt \ + --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ + --reports spellcheck_reports/spellcheck_report.json \ + > spellcheck_reports/spellcheck_output.txt + - name: Create GitHub Issue for Misspellings + if: ${{ steps.spellchecker-cli.outcome == 'success' }} + uses: peter-evans/create-issue-from-file@v4 + with: + title: Documentation contains misspelled words + content-filepath: spellcheck_reports/spellcheck_output.txt + labels: documentation, spelling-error \ No newline at end of file diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml deleted file mode 100644 index f103891..0000000 --- a/.github/workflows/check-links.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Check Links - -on: - push: { branches: [ main ] } - workflow_dispatch: { } - workflow_call: { } - -jobs: - check-links: - name: Check Links in Documentation - runs-on: ubuntu-latest - steps: - - name: Check out commit - uses: actions/checkout@v4 - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - name: Run Markdown Link Check - uses: gaurav-nelson/github-action-markdown-link-check@v1 - id: linkcheck - continue-on-error: true - with: - use-quiet-mode: yes - use-verbose-mode: no - folder-path: 'artifacts/' - max-depth: -1 - file-extension: .html - base-branch: main - output: linkcheck_output.txt - - name: Save Link Check Output - run: | - mkdir -p linkcheck_reports - echo "${{ steps.linkcheck.outputs.result }}" > linkcheck_reports/linkcheck_output.txt - ls - ls linkcheck_reports - - name: Create GitHub Issue for Broken Links - if: ${{ steps.linkcheck.outcome != 'success' }} - uses: peter-evans/create-issue-from-file@v4 - with: - title: Broken links detected in documentation - content-filepath: linkcheck_reports/linkcheck_output.txt - labels: documentation, broken-link \ No newline at end of file diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml deleted file mode 100644 index cc2014a..0000000 --- a/.github/workflows/check-spelling.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Check Spelling - -on: - push: { branches: [ main ] } - workflow_dispatch: { } - workflow_call: { } - -jobs: - check-spelling: - name: Check Spelling in Documentation - runs-on: ubuntu-latest - steps: - - name: Check out commit # Docs: https://github.com/actions/checkout - uses: actions/checkout@v4 - - name: Download all artifacts - uses: actions/download-artifact@v4 # Docs: https://github.com/actions/download-artifact - with: - path: artifacts - - name: Run Spell Checker - id: spellchecker-cli - continue-on-error: true - run: | - mkdir -p spellcheck_reports - npx -y spellchecker-cli --files artifacts/**/*.html \ - --dictionaries .github/workflows/dictionary.txt \ - --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports spellcheck_reports/spellcheck_report.json \ - > spellcheck_reports/spellcheck_output.txt - ls - ls spellcheck_reports/ - # - name: Upload Spell Check Artifacts - # uses: actions/upload-artifact@v3 - # if: ${{ steps.spellchecker-cli.outcome == 'success' }} - # with: - # path: spellcheck_reports - - name: Create GitHub Issue for Misspellings - if: ${{ steps.spellchecker-cli.outcome == 'success' }} - uses: peter-evans/create-issue-from-file@v4 - with: - title: Documentation contains misspelled words - content-filepath: spellcheck_reports/spellcheck_output.txt - labels: documentation, spelling-error \ No newline at end of file diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml index 929a3af..9229446 100644 --- a/.github/workflows/deploy-to-gh-pages.yml +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -62,12 +62,11 @@ jobs: with: path: _build/html - check-links: - name: Check Links - uses: ./.github/workflows/check-links.yml - check-spelling: - name: Check Spelling - uses: ./.github/workflows/check-spelling.yml + check-links-and-spelling: + name: Check Links and Spelling in Documentation + uses: ./.github/workflows/check-links-and-spelling.yml + needs: build + # deploy: # name: Deploy website From e49d7e47a2cb0fa3373e977e0a51ad726016e315 Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Wed, 15 Jan 2025 00:07:09 -0800 Subject: [PATCH 10/58] change spell check output --- .github/workflows/check-links-and-spelling.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 7dce330..860f527 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -37,7 +37,6 @@ jobs: max-depth: -1 file-extension: .html base-branch: main - output: linkcheck_output.txt - name: Save Link Check Output run: | mkdir -p linkcheck_reports @@ -65,11 +64,14 @@ jobs: continue-on-error: true run: | mkdir -p spellcheck_reports - npx -y spellchecker-cli --files artifacts/**/*.html \ + npx -y spellchecker-cli \ + --files artifacts/**/*.html \ --dictionaries .github/workflows/dictionary.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports spellcheck_reports/spellcheck_report.json \ - > spellcheck_reports/spellcheck_output.txt + --reports spellcheck_reports/spellcheck_report.json + - name: Save Spell Check Output + run: | + echo "${{ steps.linkcheck.outputs.result }}" > spellcheck_reports/spellcheck_output.txt - name: Create GitHub Issue for Misspellings if: ${{ steps.spellchecker-cli.outcome == 'success' }} uses: peter-evans/create-issue-from-file@v4 From c3d6013e9e61daae316b04c2b00352f2fcd5376c Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Wed, 15 Jan 2025 00:19:11 -0800 Subject: [PATCH 11/58] added resource links --- .github/workflows/check-links-and-spelling.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 860f527..d9a2a55 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -27,16 +27,16 @@ jobs: with: path: artifacts - name: Run Markdown Link Check - uses: gaurav-nelson/github-action-markdown-link-check@v1 + uses: gaurav-nelson/github-action-markdown-link-check@v1 # Source: https://github.com/tcort/markdown-link-check id: linkcheck continue-on-error: true with: use-quiet-mode: yes use-verbose-mode: no - folder-path: artifacts + folder-path: 'artifacts/' max-depth: -1 - file-extension: .html - base-branch: main + file-extension: '.html' + base-branch: 'main' - name: Save Link Check Output run: | mkdir -p linkcheck_reports @@ -62,6 +62,8 @@ jobs: - name: Run Spell Checker id: spellchecker-cli continue-on-error: true + # Source: https://github.com/tbroadley/spellchecker-cli and https://github.com/austenstone/spellchecker-cli-action-summary + # Based off: https://github.com/austenstone/spellchecker-cli-action-summary/blob/main/.github/workflows/spellcheck.yml run: | mkdir -p spellcheck_reports npx -y spellchecker-cli \ From 62f52ce0ba3845d56da8afa057d3e69e4590504d Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Wed, 15 Jan 2025 00:19:52 -0800 Subject: [PATCH 12/58] typo --- .github/workflows/check-links-and-spelling.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index d9a2a55..aea5efb 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -73,7 +73,7 @@ jobs: --reports spellcheck_reports/spellcheck_report.json - name: Save Spell Check Output run: | - echo "${{ steps.linkcheck.outputs.result }}" > spellcheck_reports/spellcheck_output.txt + echo "${{ steps.spellchecker-cli.outputs.result }}" > spellcheck_reports/spellcheck_output.txt - name: Create GitHub Issue for Misspellings if: ${{ steps.spellchecker-cli.outcome == 'success' }} uses: peter-evans/create-issue-from-file@v4 From 8a7c3f7937359bec32866b176c1eb061fd2283ba Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Wed, 15 Jan 2025 00:32:08 -0800 Subject: [PATCH 13/58] fix logic for spell check ticket creation --- .github/workflows/check-links-and-spelling.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index aea5efb..0a66e34 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -75,7 +75,7 @@ jobs: run: | echo "${{ steps.spellchecker-cli.outputs.result }}" > spellcheck_reports/spellcheck_output.txt - name: Create GitHub Issue for Misspellings - if: ${{ steps.spellchecker-cli.outcome == 'success' }} + if: ${{ steps.spellchecker-cli.outcome != 'success' }} uses: peter-evans/create-issue-from-file@v4 with: title: Documentation contains misspelled words From 720dafae4cf1832a0d8e79b876a66f9d8129f692 Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Wed, 15 Jan 2025 01:00:09 -0800 Subject: [PATCH 14/58] trying to grab workflow outputs --- .github/workflows/check-links-and-spelling.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 0a66e34..2142df4 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -40,7 +40,7 @@ jobs: - name: Save Link Check Output run: | mkdir -p linkcheck_reports - echo "${{ steps.linkcheck.outputs.result }}" > linkcheck_reports/linkcheck_output.txt + echo "${{ steps.linkcheck.outputs }}" > linkcheck_reports/linkcheck_output.txt - name: Create GitHub Issue for Broken Links if: ${{ steps.linkcheck.outcome != 'success' }} uses: peter-evans/create-issue-from-file@v4 @@ -73,11 +73,11 @@ jobs: --reports spellcheck_reports/spellcheck_report.json - name: Save Spell Check Output run: | - echo "${{ steps.spellchecker-cli.outputs.result }}" > spellcheck_reports/spellcheck_output.txt + echo "${{ steps.spellchecker-cli.outputs }}" > spellcheck_reports/spellcheck_output.txt - name: Create GitHub Issue for Misspellings if: ${{ steps.spellchecker-cli.outcome != 'success' }} uses: peter-evans/create-issue-from-file@v4 with: title: Documentation contains misspelled words - content-filepath: spellcheck_reports/spellcheck_output.txt + content-filepath: spellcheck_reports/spellcheck_report.json labels: documentation, spelling-error \ No newline at end of file From 30b3adcf15cea6286a92d1a1712b822b3b5c8f06 Mon Sep 17 00:00:00 2001 From: Kaitlyn Jiayi Li Date: Wed, 15 Jan 2025 01:20:28 -0800 Subject: [PATCH 15/58] pipe std out for spell check --- .github/workflows/check-links-and-spelling.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 2142df4..c900d2e 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -70,14 +70,12 @@ jobs: --files artifacts/**/*.html \ --dictionaries .github/workflows/dictionary.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports spellcheck_reports/spellcheck_report.json - - name: Save Spell Check Output - run: | - echo "${{ steps.spellchecker-cli.outputs }}" > spellcheck_reports/spellcheck_output.txt + --reports spellcheck_reports/spellcheck_report.json \ + > spellcheck_reports/spellcheck_output.txt - name: Create GitHub Issue for Misspellings if: ${{ steps.spellchecker-cli.outcome != 'success' }} uses: peter-evans/create-issue-from-file@v4 with: title: Documentation contains misspelled words - content-filepath: spellcheck_reports/spellcheck_report.json + content-filepath: spellcheck_reports/spellcheck_output.txt labels: documentation, spelling-error \ No newline at end of file From 4df458266720f4623244e5674b7f3224a804242d Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 12:24:18 -0700 Subject: [PATCH 16/58] changed allow list name and link check call --- .github/workflows/.linkspector.yml | 0 .../workflows/check-links-and-spelling.yml | 38 +++++++++++++------ ...ctionary.txt => spellcheck_allow_list.txt} | 0 3 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/.linkspector.yml rename .github/workflows/{dictionary.txt => spellcheck_allow_list.txt} (100%) diff --git a/.github/workflows/.linkspector.yml b/.github/workflows/.linkspector.yml new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index c900d2e..dea7be1 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -30,17 +30,32 @@ jobs: uses: gaurav-nelson/github-action-markdown-link-check@v1 # Source: https://github.com/tcort/markdown-link-check id: linkcheck continue-on-error: true - with: - use-quiet-mode: yes - use-verbose-mode: no - folder-path: 'artifacts/' - max-depth: -1 - file-extension: '.html' - base-branch: 'main' - - name: Save Link Check Output + # with: + # use-quiet-mode: yes + # use-verbose-mode: no + # folder-path: 'artifacts/' + # max-depth: -1 + # file-extension: '.html' + # base-branch: 'main' run: | mkdir -p linkcheck_reports - echo "${{ steps.linkcheck.outputs }}" > linkcheck_reports/linkcheck_output.txt + npx -y markdown-link-check \ + --quiet \ + --verbose \ + artifacts/**/*.html \ + > linkcheck_reports/linkcheck_output.txt + + # - name: Run linkspector + # uses: umbrelladocs/action-linkspector@v1 + # with: + # # github_token: ${{ secrets.github_token }} + # reporter: github-pr-review + # filter_mode: nofilter + # fail_on_error: false + # - name: Save Link Check Output + # run: | + # mkdir -p linkcheck_reports + # echo "${{ steps.linkcheck.outputs }}" > linkcheck_reports/linkcheck_output.txt - name: Create GitHub Issue for Broken Links if: ${{ steps.linkcheck.outcome != 'success' }} uses: peter-evans/create-issue-from-file@v4 @@ -68,9 +83,10 @@ jobs: mkdir -p spellcheck_reports npx -y spellchecker-cli \ --files artifacts/**/*.html \ - --dictionaries .github/workflows/dictionary.txt \ + --dictionaries .github/workflows/spellcheck_allow_list.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports spellcheck_reports/spellcheck_report.json \ + --reports spellcheck_reports/spellcheck_report.json | + grep "misspelt" \ > spellcheck_reports/spellcheck_output.txt - name: Create GitHub Issue for Misspellings if: ${{ steps.spellchecker-cli.outcome != 'success' }} diff --git a/.github/workflows/dictionary.txt b/.github/workflows/spellcheck_allow_list.txt similarity index 100% rename from .github/workflows/dictionary.txt rename to .github/workflows/spellcheck_allow_list.txt From 746549a5749db2300ad8b239e96c1275ba414afc Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 12:24:42 -0700 Subject: [PATCH 17/58] removed file used to test --- .github/workflows/.linkspector.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .github/workflows/.linkspector.yml diff --git a/.github/workflows/.linkspector.yml b/.github/workflows/.linkspector.yml deleted file mode 100644 index e69de29..0000000 From f5613c4581511b79e0ef16a0fc1c1faf23bf8738 Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 12:25:34 -0700 Subject: [PATCH 18/58] remove uses in link check --- .github/workflows/check-links-and-spelling.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index dea7be1..741c844 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -27,7 +27,7 @@ jobs: with: path: artifacts - name: Run Markdown Link Check - uses: gaurav-nelson/github-action-markdown-link-check@v1 # Source: https://github.com/tcort/markdown-link-check + # uses: gaurav-nelson/github-action-markdown-link-check@v1 # Source: https://github.com/tcort/markdown-link-check id: linkcheck continue-on-error: true # with: From 239e7d8c7fc32dcbcbeea4b78624d4bc1554b8be Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 12:29:45 -0700 Subject: [PATCH 19/58] use verbose mode --- .github/workflows/check-links-and-spelling.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 741c844..f28df43 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -40,7 +40,6 @@ jobs: run: | mkdir -p linkcheck_reports npx -y markdown-link-check \ - --quiet \ --verbose \ artifacts/**/*.html \ > linkcheck_reports/linkcheck_output.txt From ac9f592687b47c257a0b502d17781851045ffe6d Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 12:33:55 -0700 Subject: [PATCH 20/58] testing npx usage --- .../workflows/check-links-and-spelling.yml | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index f28df43..f1c6654 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -39,10 +39,10 @@ jobs: # base-branch: 'main' run: | mkdir -p linkcheck_reports - npx -y markdown-link-check \ + npx markdown-link-check \ --verbose \ - artifacts/**/*.html \ - > linkcheck_reports/linkcheck_output.txt + artifacts/**/*.html + # > linkcheck_reports/linkcheck_output.txt # - name: Run linkspector # uses: umbrelladocs/action-linkspector@v1 @@ -55,13 +55,13 @@ jobs: # run: | # mkdir -p linkcheck_reports # echo "${{ steps.linkcheck.outputs }}" > linkcheck_reports/linkcheck_output.txt - - name: Create GitHub Issue for Broken Links - if: ${{ steps.linkcheck.outcome != 'success' }} - uses: peter-evans/create-issue-from-file@v4 - with: - title: Broken links detected in documentation - content-filepath: linkcheck_reports/linkcheck_output.txt - labels: documentation, broken-link + # - name: Create GitHub Issue for Broken Links + # if: ${{ steps.linkcheck.outcome != 'success' }} + # uses: peter-evans/create-issue-from-file@v4 + # with: + # title: Broken links detected in documentation + # content-filepath: linkcheck_reports/linkcheck_output.txt + # labels: documentation, broken-link check-spelling: name: Check Spelling in Documentation @@ -87,10 +87,10 @@ jobs: --reports spellcheck_reports/spellcheck_report.json | grep "misspelt" \ > spellcheck_reports/spellcheck_output.txt - - name: Create GitHub Issue for Misspellings - if: ${{ steps.spellchecker-cli.outcome != 'success' }} - uses: peter-evans/create-issue-from-file@v4 - with: - title: Documentation contains misspelled words - content-filepath: spellcheck_reports/spellcheck_output.txt - labels: documentation, spelling-error \ No newline at end of file + # - name: Create GitHub Issue for Misspellings + # if: ${{ steps.spellchecker-cli.outcome != 'success' }} + # uses: peter-evans/create-issue-from-file@v4 + # with: + # title: Documentation contains misspelled words + # content-filepath: spellcheck_reports/spellcheck_output.txt + # labels: documentation, spelling-error \ No newline at end of file From ab1a28ed80e79fda8d82bb908ac3dbf14cadb0eb Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 12:42:32 -0700 Subject: [PATCH 21/58] add quiet mode --- .github/workflows/check-links-and-spelling.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index f1c6654..6d1f2dd 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -40,6 +40,7 @@ jobs: run: | mkdir -p linkcheck_reports npx markdown-link-check \ + --quiet \ --verbose \ artifacts/**/*.html # > linkcheck_reports/linkcheck_output.txt From abb4a973f1c380b83ce5cb9cee26fb96e816319e Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 12:51:42 -0700 Subject: [PATCH 22/58] tee stdout instead of pipe --- .../workflows/check-links-and-spelling.yml | 32 ++++++------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 6d1f2dd..b5926aa 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -42,27 +42,16 @@ jobs: npx markdown-link-check \ --quiet \ --verbose \ - artifacts/**/*.html - # > linkcheck_reports/linkcheck_output.txt + artifacts/**/*.html | + tee linkcheck_reports/linkcheck_output.txt - # - name: Run linkspector - # uses: umbrelladocs/action-linkspector@v1 - # with: - # # github_token: ${{ secrets.github_token }} - # reporter: github-pr-review - # filter_mode: nofilter - # fail_on_error: false - # - name: Save Link Check Output - # run: | - # mkdir -p linkcheck_reports - # echo "${{ steps.linkcheck.outputs }}" > linkcheck_reports/linkcheck_output.txt - # - name: Create GitHub Issue for Broken Links - # if: ${{ steps.linkcheck.outcome != 'success' }} - # uses: peter-evans/create-issue-from-file@v4 - # with: - # title: Broken links detected in documentation - # content-filepath: linkcheck_reports/linkcheck_output.txt - # labels: documentation, broken-link + - name: Create GitHub Issue for Broken Links + if: ${{ contains("ERROR", linkcheck_reports/linkcheck_output.txt) }} + uses: peter-evans/create-issue-from-file@v4 + with: + title: Broken links detected in documentation + content-filepath: linkcheck_reports/linkcheck_output.txt + labels: documentation, broken-link check-spelling: name: Check Spelling in Documentation @@ -86,8 +75,7 @@ jobs: --dictionaries .github/workflows/spellcheck_allow_list.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ --reports spellcheck_reports/spellcheck_report.json | - grep "misspelt" \ - > spellcheck_reports/spellcheck_output.txt + tee spellcheck_reports/spellcheck_output.txt # - name: Create GitHub Issue for Misspellings # if: ${{ steps.spellchecker-cli.outcome != 'success' }} # uses: peter-evans/create-issue-from-file@v4 From 91f526a685c994ff1412ab09f0981df3d4df17d6 Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 12:53:07 -0700 Subject: [PATCH 23/58] change error search --- .github/workflows/check-links-and-spelling.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index b5926aa..bf5dacc 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -46,7 +46,7 @@ jobs: tee linkcheck_reports/linkcheck_output.txt - name: Create GitHub Issue for Broken Links - if: ${{ contains("ERROR", linkcheck_reports/linkcheck_output.txt) }} + if: ${{ contains(linkcheck_reports/linkcheck_output.txt, 'ERROR') }} uses: peter-evans/create-issue-from-file@v4 with: title: Broken links detected in documentation From 4f80cd0492da2bfcc83b6b5b0cb13dc38077c9a6 Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 13:05:03 -0700 Subject: [PATCH 24/58] use boolean to activate github issue creation --- .../workflows/check-links-and-spelling.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index bf5dacc..35bc099 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -45,8 +45,14 @@ jobs: artifacts/**/*.html | tee linkcheck_reports/linkcheck_output.txt + if grep -q 'ERROR' linkcheck_reports/linkcheck_output.txt; then + echo "links_broken=true" >> $GITHUB_OUTPUT + else + echo "links_broken=false" >> $GITHUB_OUTPUT + fi + - name: Create GitHub Issue for Broken Links - if: ${{ contains(linkcheck_reports/linkcheck_output.txt, 'ERROR') }} + if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} uses: peter-evans/create-issue-from-file@v4 with: title: Broken links detected in documentation @@ -64,7 +70,7 @@ jobs: with: path: artifacts - name: Run Spell Checker - id: spellchecker-cli + id: spellcheck continue-on-error: true # Source: https://github.com/tbroadley/spellchecker-cli and https://github.com/austenstone/spellchecker-cli-action-summary # Based off: https://github.com/austenstone/spellchecker-cli-action-summary/blob/main/.github/workflows/spellcheck.yml @@ -76,8 +82,15 @@ jobs: --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ --reports spellcheck_reports/spellcheck_report.json | tee spellcheck_reports/spellcheck_output.txt + + if grep -q 'misspelt' spellcheck_reports/spellcheck_output.txt; then + echo "misspelt=true" >> $GITHUB_OUTPUT + else + echo "misspelt=false" >> $GITHUB_OUTPUT + fi + # - name: Create GitHub Issue for Misspellings - # if: ${{ steps.spellchecker-cli.outcome != 'success' }} + # if: ${{ steps.spellcheck.outputs.misspelt == 'true' }} # uses: peter-evans/create-issue-from-file@v4 # with: # title: Documentation contains misspelled words From 728a56d0f370914cddfeb8539a3061d53f9a3a88 Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 13:17:09 -0700 Subject: [PATCH 25/58] check output files --- .github/workflows/check-links-and-spelling.yml | 8 +++++--- .github/workflows/spellcheck_allow_list.txt | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 35bc099..a848e49 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -14,6 +14,7 @@ on: push: { branches: [ main ] } workflow_dispatch: { } workflow_call: { } + pull_request: {} jobs: check-links: @@ -44,7 +45,7 @@ jobs: --verbose \ artifacts/**/*.html | tee linkcheck_reports/linkcheck_output.txt - + grep -q 'ERROR' linkcheck_reports/linkcheck_output.txt if grep -q 'ERROR' linkcheck_reports/linkcheck_output.txt; then echo "links_broken=true" >> $GITHUB_OUTPUT else @@ -82,7 +83,8 @@ jobs: --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ --reports spellcheck_reports/spellcheck_report.json | tee spellcheck_reports/spellcheck_output.txt - + cat spellcheck_reports/spellcheck_report.json + grep -q 'misspelt' spellcheck_reports/spellcheck_output.txt if grep -q 'misspelt' spellcheck_reports/spellcheck_output.txt; then echo "misspelt=true" >> $GITHUB_OUTPUT else @@ -94,5 +96,5 @@ jobs: # uses: peter-evans/create-issue-from-file@v4 # with: # title: Documentation contains misspelled words - # content-filepath: spellcheck_reports/spellcheck_output.txt + # content-filepath: spellcheck_reports/spellcheck_report.json # labels: documentation, spelling-error \ No newline at end of file diff --git a/.github/workflows/spellcheck_allow_list.txt b/.github/workflows/spellcheck_allow_list.txt index 981ff7c..7078e87 100644 --- a/.github/workflows/spellcheck_allow_list.txt +++ b/.github/workflows/spellcheck_allow_list.txt @@ -4,6 +4,8 @@ Biosample biosample Changesheets changesheets +Community-centric +community-centric Diátaxis Globus IMG From d3a8e4649f4f03bbfdeb5f5acc5e8945bd7165c9 Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 13:26:11 -0700 Subject: [PATCH 26/58] testing json usage --- .../workflows/check-links-and-spelling.yml | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index a848e49..707e672 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -27,17 +27,9 @@ jobs: uses: actions/download-artifact@v4 with: path: artifacts - - name: Run Markdown Link Check - # uses: gaurav-nelson/github-action-markdown-link-check@v1 # Source: https://github.com/tcort/markdown-link-check + - name: Run Markdown Link Check # Source: https://github.com/tcort/markdown-link-check id: linkcheck continue-on-error: true - # with: - # use-quiet-mode: yes - # use-verbose-mode: no - # folder-path: 'artifacts/' - # max-depth: -1 - # file-extension: '.html' - # base-branch: 'main' run: | mkdir -p linkcheck_reports npx markdown-link-check \ @@ -45,8 +37,8 @@ jobs: --verbose \ artifacts/**/*.html | tee linkcheck_reports/linkcheck_output.txt - grep -q 'ERROR' linkcheck_reports/linkcheck_output.txt - if grep -q 'ERROR' linkcheck_reports/linkcheck_output.txt; then + # grep -q 'ERROR' linkcheck_reports/linkcheck_output.txt + if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then echo "links_broken=true" >> $GITHUB_OUTPUT else echo "links_broken=false" >> $GITHUB_OUTPUT @@ -81,20 +73,20 @@ jobs: --files artifacts/**/*.html \ --dictionaries .github/workflows/spellcheck_allow_list.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports spellcheck_reports/spellcheck_report.json | - tee spellcheck_reports/spellcheck_output.txt - cat spellcheck_reports/spellcheck_report.json - grep -q 'misspelt' spellcheck_reports/spellcheck_output.txt + --reports spellcheck_reports/spellcheck_report.json + # tee spellcheck_reports/spellcheck_output.txt + # cat spellcheck_reports/spellcheck_report.json + # grep -q 'misspelt' spellcheck_reports/spellcheck_output.txt if grep -q 'misspelt' spellcheck_reports/spellcheck_output.txt; then echo "misspelt=true" >> $GITHUB_OUTPUT else echo "misspelt=false" >> $GITHUB_OUTPUT fi - # - name: Create GitHub Issue for Misspellings - # if: ${{ steps.spellcheck.outputs.misspelt == 'true' }} - # uses: peter-evans/create-issue-from-file@v4 - # with: - # title: Documentation contains misspelled words - # content-filepath: spellcheck_reports/spellcheck_report.json - # labels: documentation, spelling-error \ No newline at end of file + - name: Create GitHub Issue for Misspellings + if: ${{ steps.spellcheck.outputs.misspelt == 'true' }} + uses: peter-evans/create-issue-from-file@v4 + with: + title: Documentation contains misspelled words + content-filepath: spellcheck_reports/spellcheck_report.json + labels: documentation, spelling-error \ No newline at end of file From 4621a3159ae2d3f0deb25ef81bc6366a2491a336 Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 13:29:06 -0700 Subject: [PATCH 27/58] check syntax --- .github/workflows/check-links-and-spelling.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 707e672..c149ffe 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -27,7 +27,7 @@ jobs: uses: actions/download-artifact@v4 with: path: artifacts - - name: Run Markdown Link Check # Source: https://github.com/tcort/markdown-link-check + - name: Run Markdown Link Check # Source: https://github.com/tcort/markdown-link-check id: linkcheck continue-on-error: true run: | @@ -39,9 +39,9 @@ jobs: tee linkcheck_reports/linkcheck_output.txt # grep -q 'ERROR' linkcheck_reports/linkcheck_output.txt if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then - echo "links_broken=true" >> $GITHUB_OUTPUT + echo "links_broken=true" >> $GITHUB_ENV else - echo "links_broken=false" >> $GITHUB_OUTPUT + echo "links_broken=false" >> $GITHUB_ENV fi - name: Create GitHub Issue for Broken Links @@ -77,7 +77,7 @@ jobs: # tee spellcheck_reports/spellcheck_output.txt # cat spellcheck_reports/spellcheck_report.json # grep -q 'misspelt' spellcheck_reports/spellcheck_output.txt - if grep -q 'misspelt' spellcheck_reports/spellcheck_output.txt; then + if grep -q 'misspelt' spellcheck_reports/spellcheck_report.json; then echo "misspelt=true" >> $GITHUB_OUTPUT else echo "misspelt=false" >> $GITHUB_OUTPUT From 20dc8c33cd964236fbdea33ce621ac73d9cda418 Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 13:32:45 -0700 Subject: [PATCH 28/58] remove commented code --- .github/workflows/check-links-and-spelling.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index c149ffe..fe5e27a 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -27,8 +27,10 @@ jobs: uses: actions/download-artifact@v4 with: path: artifacts - - name: Run Markdown Link Check # Source: https://github.com/tcort/markdown-link-check + + - name: Run Markdown Link Check id: linkcheck + # Source: https://github.com/tcort/markdown-link-check continue-on-error: true run: | mkdir -p linkcheck_reports From 27f3287085d5362a2d9cc9f9fcc3bfb426a88d9c Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 13:35:17 -0700 Subject: [PATCH 29/58] i don't know why it's not working --- .../workflows/check-links-and-spelling.yml | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index fe5e27a..f0d589a 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -1,7 +1,7 @@ ############################################################################### # Introduction: # ------------- -# This workflow builds the NMDC documentation, checks for broken links, +# This workflow builds the NMDC documentation, checks for broken links, # and identifies any spelling errors in the documentation. # If any issues are found (broken links or misspelled words), it creates # GitHub Issues containing lists of the errors for further review and fixing. @@ -21,25 +21,23 @@ jobs: name: Check Links in Documentation runs-on: ubuntu-latest steps: - - name: Check out commit + - name: Check out commit uses: actions/checkout@v4 - name: Download all artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v4 with: path: artifacts - - - name: Run Markdown Link Check + - name: Run Markdown Link Check id: linkcheck # Source: https://github.com/tcort/markdown-link-check continue-on-error: true run: | - mkdir -p linkcheck_reports + mkdir -p linkcheck_reports npx markdown-link-check \ --quiet \ --verbose \ artifacts/**/*.html | tee linkcheck_reports/linkcheck_output.txt - # grep -q 'ERROR' linkcheck_reports/linkcheck_output.txt if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then echo "links_broken=true" >> $GITHUB_ENV else @@ -58,10 +56,10 @@ jobs: name: Check Spelling in Documentation runs-on: ubuntu-latest steps: - - name: Check out commit + - name: Check out commit uses: actions/checkout@v4 - name: Download all artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v4 with: path: artifacts - name: Run Spell Checker @@ -75,10 +73,7 @@ jobs: --files artifacts/**/*.html \ --dictionaries .github/workflows/spellcheck_allow_list.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports spellcheck_reports/spellcheck_report.json - # tee spellcheck_reports/spellcheck_output.txt - # cat spellcheck_reports/spellcheck_report.json - # grep -q 'misspelt' spellcheck_reports/spellcheck_output.txt + --reports spellcheck_reports/spellcheck_report.json if grep -q 'misspelt' spellcheck_reports/spellcheck_report.json; then echo "misspelt=true" >> $GITHUB_OUTPUT else From 035303e7dc7a000b6d986cc1ef5cca3c63a35b69 Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 13:40:27 -0700 Subject: [PATCH 30/58] change logic for ticket creation --- .../workflows/check-links-and-spelling.yml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index f0d589a..3072fdc 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -38,14 +38,14 @@ jobs: --verbose \ artifacts/**/*.html | tee linkcheck_reports/linkcheck_output.txt - if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then - echo "links_broken=true" >> $GITHUB_ENV - else - echo "links_broken=false" >> $GITHUB_ENV - fi + # if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then + # echo "links_broken=true" >> $GITHUB_ENV + # else + # echo "links_broken=false" >> $GITHUB_ENV + # fi - name: Create GitHub Issue for Broken Links - if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} + if: ${{ steps.linkcheck.outcome != 'success' }} uses: peter-evans/create-issue-from-file@v4 with: title: Broken links detected in documentation @@ -74,14 +74,14 @@ jobs: --dictionaries .github/workflows/spellcheck_allow_list.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ --reports spellcheck_reports/spellcheck_report.json - if grep -q 'misspelt' spellcheck_reports/spellcheck_report.json; then - echo "misspelt=true" >> $GITHUB_OUTPUT - else - echo "misspelt=false" >> $GITHUB_OUTPUT - fi + # if grep -q 'misspelt' spellcheck_reports/spellcheck_report.json; then + # echo "misspelt=true" >> $GITHUB_OUTPUT + # else + # echo "misspelt=false" >> $GITHUB_OUTPUT + # fi - name: Create GitHub Issue for Misspellings - if: ${{ steps.spellcheck.outputs.misspelt == 'true' }} + if: ${{ steps.spellcheck.outcome != 'success' }} uses: peter-evans/create-issue-from-file@v4 with: title: Documentation contains misspelled words From 1cf94733444e75a45eefff0fc72f3b532e88af0e Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 14:49:52 -0700 Subject: [PATCH 31/58] try again with github output var --- .github/workflows/check-links-and-spelling.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 3072fdc..0679020 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -38,14 +38,14 @@ jobs: --verbose \ artifacts/**/*.html | tee linkcheck_reports/linkcheck_output.txt - # if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then - # echo "links_broken=true" >> $GITHUB_ENV - # else - # echo "links_broken=false" >> $GITHUB_ENV - # fi + if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then + echo "links_broken=true" >> $GITHUB_OUTPUT + else + echo "links_broken=false" >> $GITHUB_OUTPUT + fi - name: Create GitHub Issue for Broken Links - if: ${{ steps.linkcheck.outcome != 'success' }} + if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} uses: peter-evans/create-issue-from-file@v4 with: title: Broken links detected in documentation @@ -73,7 +73,8 @@ jobs: --files artifacts/**/*.html \ --dictionaries .github/workflows/spellcheck_allow_list.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports spellcheck_reports/spellcheck_report.json + --reports spellcheck_reports/spellcheck_report.json | + tee spellcheck_reports/spellcheck_output.txt # if grep -q 'misspelt' spellcheck_reports/spellcheck_report.json; then # echo "misspelt=true" >> $GITHUB_OUTPUT # else @@ -85,5 +86,5 @@ jobs: uses: peter-evans/create-issue-from-file@v4 with: title: Documentation contains misspelled words - content-filepath: spellcheck_reports/spellcheck_report.json + content-filepath: spellcheck_reports/spellcheck_output.txt labels: documentation, spelling-error \ No newline at end of file From 02a99c97bf6ba8dfdee5fb4c0cb437b417f40b51 Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 14:56:33 -0700 Subject: [PATCH 32/58] testing spell check issue creation --- .../workflows/check-links-and-spelling.yml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 0679020..d458193 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -44,13 +44,13 @@ jobs: echo "links_broken=false" >> $GITHUB_OUTPUT fi - - name: Create GitHub Issue for Broken Links - if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} - uses: peter-evans/create-issue-from-file@v4 - with: - title: Broken links detected in documentation - content-filepath: linkcheck_reports/linkcheck_output.txt - labels: documentation, broken-link + # - name: Create GitHub Issue for Broken Links + # if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} + # uses: peter-evans/create-issue-from-file@v4 + # with: + # title: Broken links detected in documentation + # content-filepath: linkcheck_reports/linkcheck_output.txt + # labels: documentation, broken-link check-spelling: name: Check Spelling in Documentation @@ -75,14 +75,14 @@ jobs: --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ --reports spellcheck_reports/spellcheck_report.json | tee spellcheck_reports/spellcheck_output.txt - # if grep -q 'misspelt' spellcheck_reports/spellcheck_report.json; then - # echo "misspelt=true" >> $GITHUB_OUTPUT - # else - # echo "misspelt=false" >> $GITHUB_OUTPUT - # fi + if grep -q 'misspelt' spellcheck_reports/spellcheck_report.json; then + echo "misspelt=true" >> $GITHUB_OUTPUT + else + echo "misspelt=false" >> $GITHUB_OUTPUT + fi - name: Create GitHub Issue for Misspellings - if: ${{ steps.spellcheck.outcome != 'success' }} + if: ${{ steps.spellcheck.outputs.misspelt == 'true' }} uses: peter-evans/create-issue-from-file@v4 with: title: Documentation contains misspelled words From 1fb1618675606bd2d481bcd9f444dfe140aa7c5a Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 15:02:43 -0700 Subject: [PATCH 33/58] all parts working, generating pr --- .github/workflows/check-links-and-spelling.yml | 17 +++++++++-------- .github/workflows/deploy-to-gh-pages.yml | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index d458193..da42739 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -14,7 +14,8 @@ on: push: { branches: [ main ] } workflow_dispatch: { } workflow_call: { } - pull_request: {} + pull_request: + branches: [main] jobs: check-links: @@ -44,13 +45,13 @@ jobs: echo "links_broken=false" >> $GITHUB_OUTPUT fi - # - name: Create GitHub Issue for Broken Links - # if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} - # uses: peter-evans/create-issue-from-file@v4 - # with: - # title: Broken links detected in documentation - # content-filepath: linkcheck_reports/linkcheck_output.txt - # labels: documentation, broken-link + - name: Create GitHub Issue for Broken Links + if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} + uses: peter-evans/create-issue-from-file@v4 + with: + title: Broken links detected in documentation + content-filepath: linkcheck_reports/linkcheck_output.txt + labels: documentation, broken-link check-spelling: name: Check Spelling in Documentation diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml index 9229446..f93bda8 100644 --- a/.github/workflows/deploy-to-gh-pages.yml +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -3,7 +3,7 @@ name: Build and deploy to GitHub Pages on: - push: { branches: [ 61-add-link-checker ] } + push: { branches: [ main ] } workflow_dispatch: { } # Reference: https://docs.github.com/en/actions/using-jobs/using-concurrency From 795e3f37a8ec5e2094572d027a32dec1af26c25f Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Fri, 17 Jan 2025 15:14:32 -0700 Subject: [PATCH 34/58] commenting out pull request run because logically, it needs some thinking for things other than html files for documentation deployment --- .github/workflows/check-links-and-spelling.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index da42739..bf7bfaa 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -14,8 +14,8 @@ on: push: { branches: [ main ] } workflow_dispatch: { } workflow_call: { } - pull_request: - branches: [main] + # pull_request: + # branches: [main] jobs: check-links: From 839c64d89fa9fb2fd178bcea2db2cd7a6a72dabd Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Tue, 28 Jan 2025 16:32:44 -0700 Subject: [PATCH 35/58] retesting checkers --- .../workflows/check-links-and-spelling.yml | 32 +++++++++++-------- .github/workflows/deploy-to-gh-pages.yml | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index bf7bfaa..a880c4a 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -11,7 +11,7 @@ name: Check Links and Spelling in Documentation on: - push: { branches: [ main ] } + # push: { branches: [ main ] } workflow_dispatch: { } workflow_call: { } # pull_request: @@ -30,20 +30,26 @@ jobs: path: artifacts - name: Run Markdown Link Check id: linkcheck - # Source: https://github.com/tcort/markdown-link-check + # Source: https://github.com/filiph/linkcheck continue-on-error: true run: | - mkdir -p linkcheck_reports - npx markdown-link-check \ - --quiet \ - --verbose \ - artifacts/**/*.html | - tee linkcheck_reports/linkcheck_output.txt - if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then - echo "links_broken=true" >> $GITHUB_OUTPUT - else - echo "links_broken=false" >> $GITHUB_OUTPUT - fi + npx linkinator "artifacts/**/*.html" \ + --verbosity DEBUG \ + --recurse | + tee linkcheck_reports/linkcheck_output.txt + + # run: | + # mkdir -p linkcheck_reports + # npx linkinator artifacts/ --recurse \ + # --quiet \ + # --verbose \ + # artifacts/**/*.html | + # tee linkcheck_reports/linkcheck_output.txt + # if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then + # echo "links_broken=true" >> $GITHUB_OUTPUT + # else + # echo "links_broken=false" >> $GITHUB_OUTPUT + # fi - name: Create GitHub Issue for Broken Links if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml index f93bda8..9229446 100644 --- a/.github/workflows/deploy-to-gh-pages.yml +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -3,7 +3,7 @@ name: Build and deploy to GitHub Pages on: - push: { branches: [ main ] } + push: { branches: [ 61-add-link-checker ] } workflow_dispatch: { } # Reference: https://docs.github.com/en/actions/using-jobs/using-concurrency From e630babeb4f725fb00c1da4bc83ef449ae5eb9fe Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Tue, 28 Jan 2025 16:53:29 -0700 Subject: [PATCH 36/58] add second link checker and pause issue creation --- .../workflows/check-links-and-spelling.yml | 56 +++++++++++++------ 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index a880c4a..7536980 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -28,16 +28,40 @@ jobs: uses: actions/download-artifact@v4 with: path: artifacts - - name: Run Markdown Link Check + - name: Run Markdown Link Check using linkinator id: linkcheck # Source: https://github.com/filiph/linkcheck continue-on-error: true + # run using an npm tool run: | npx linkinator "artifacts/**/*.html" \ - --verbosity DEBUG \ --recurse | tee linkcheck_reports/linkcheck_output.txt + # --verbosity DEBUG \ + check-links-pt2: + steps: + - name: Check out commit + uses: actions/checkout@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + - name: Start local Python server + run: | + python3 -m http.server 8000 & + working-directory: artifacts/ + + # 3. Wait for the server to fully start + - name: Wait for server + run: sleep 5 + + # 4. Run Filiph's linkcheck + - name: Run linkcheck + run: | + dart pub global activate linkcheck + linkcheck http://localhost:8000 + # run: | # mkdir -p linkcheck_reports # npx linkinator artifacts/ --recurse \ @@ -51,13 +75,13 @@ jobs: # echo "links_broken=false" >> $GITHUB_OUTPUT # fi - - name: Create GitHub Issue for Broken Links - if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} - uses: peter-evans/create-issue-from-file@v4 - with: - title: Broken links detected in documentation - content-filepath: linkcheck_reports/linkcheck_output.txt - labels: documentation, broken-link + # - name: Create GitHub Issue for Broken Links + # if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} + # uses: peter-evans/create-issue-from-file@v4 + # with: + # title: Broken links detected in documentation + # content-filepath: linkcheck_reports/linkcheck_output.txt + # labels: documentation, broken-link check-spelling: name: Check Spelling in Documentation @@ -88,10 +112,10 @@ jobs: echo "misspelt=false" >> $GITHUB_OUTPUT fi - - name: Create GitHub Issue for Misspellings - if: ${{ steps.spellcheck.outputs.misspelt == 'true' }} - uses: peter-evans/create-issue-from-file@v4 - with: - title: Documentation contains misspelled words - content-filepath: spellcheck_reports/spellcheck_output.txt - labels: documentation, spelling-error \ No newline at end of file + # - name: Create GitHub Issue for Misspellings + # if: ${{ steps.spellcheck.outputs.misspelt == 'true' }} + # uses: peter-evans/create-issue-from-file@v4 + # with: + # title: Documentation contains misspelled words + # content-filepath: spellcheck_reports/spellcheck_output.txt + # labels: documentation, spelling-error \ No newline at end of file From 74a2523f5a65ceb558aae6bb3eab53ceb487ad4d Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Tue, 28 Jan 2025 17:04:36 -0700 Subject: [PATCH 37/58] put another link checker in to test --- .../workflows/check-links-and-spelling.yml | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 7536980..7d405ef 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -40,6 +40,8 @@ jobs: # --verbosity DEBUG \ check-links-pt2: + name: Check Links in Documentation using linkcheck + runs-on: ubuntu-latest steps: - name: Check out commit uses: actions/checkout@v4 @@ -56,24 +58,37 @@ jobs: - name: Wait for server run: sleep 5 - # 4. Run Filiph's linkcheck - name: Run linkcheck + continue-on-error: true run: | - dart pub global activate linkcheck - linkcheck http://localhost:8000 + dart pub global activate linkcheck && linkcheck http://localhost:8000 - # run: | - # mkdir -p linkcheck_reports - # npx linkinator artifacts/ --recurse \ - # --quiet \ - # --verbose \ - # artifacts/**/*.html | - # tee linkcheck_reports/linkcheck_output.txt - # if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then - # echo "links_broken=true" >> $GITHUB_OUTPUT - # else - # echo "links_broken=false" >> $GITHUB_OUTPUT - # fi + check-links-pt3: + name: Check Links in Documentation using markdown link check + runs-on: ubuntu-latest + steps: + - name: Check out commit + uses: actions/checkout@v4 + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + - name: Run Markdown Link Check + id: linkcheck + # Source: https://github.com/tcort/markdown-link-check + continue-on-error: true + run: | + mkdir -p linkcheck_reports + npx markdown-link-check \ + --quiet \ + --verbose \ + artifacts/**/*.html | + tee linkcheck_reports/linkcheck_output.txt + if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then + echo "links_broken=true" >> $GITHUB_OUTPUT + else + echo "links_broken=false" >> $GITHUB_OUTPUT + fi # - name: Create GitHub Issue for Broken Links # if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} From 8cf2c58754f7123e799e13be2da6a8de13766316 Mon Sep 17 00:00:00 2001 From: Kaitlyn Li Date: Tue, 28 Jan 2025 17:21:43 -0700 Subject: [PATCH 38/58] remove other test link checkers and update artifact paths --- .../workflows/check-links-and-spelling.yml | 65 ++----------------- 1 file changed, 7 insertions(+), 58 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 7d405ef..452c743 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -24,72 +24,21 @@ jobs: steps: - name: Check out commit uses: actions/checkout@v4 - - name: Download all artifacts + - name: Download final build artifact uses: actions/download-artifact@v4 with: - path: artifacts + path: _build/html - name: Run Markdown Link Check using linkinator id: linkcheck - # Source: https://github.com/filiph/linkcheck + # https://www.npmjs.com/package/linkinator continue-on-error: true # run using an npm tool run: | - npx linkinator "artifacts/**/*.html" \ + npx linkinator "_build/html/**/*.html" \ --recurse | tee linkcheck_reports/linkcheck_output.txt # --verbosity DEBUG \ - check-links-pt2: - name: Check Links in Documentation using linkcheck - runs-on: ubuntu-latest - steps: - - name: Check out commit - uses: actions/checkout@v4 - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - name: Start local Python server - run: | - python3 -m http.server 8000 & - working-directory: artifacts/ - - # 3. Wait for the server to fully start - - name: Wait for server - run: sleep 5 - - - name: Run linkcheck - continue-on-error: true - run: | - dart pub global activate linkcheck && linkcheck http://localhost:8000 - - check-links-pt3: - name: Check Links in Documentation using markdown link check - runs-on: ubuntu-latest - steps: - - name: Check out commit - uses: actions/checkout@v4 - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - name: Run Markdown Link Check - id: linkcheck - # Source: https://github.com/tcort/markdown-link-check - continue-on-error: true - run: | - mkdir -p linkcheck_reports - npx markdown-link-check \ - --quiet \ - --verbose \ - artifacts/**/*.html | - tee linkcheck_reports/linkcheck_output.txt - if grep -q 'Error' linkcheck_reports/linkcheck_output.txt; then - echo "links_broken=true" >> $GITHUB_OUTPUT - else - echo "links_broken=false" >> $GITHUB_OUTPUT - fi - # - name: Create GitHub Issue for Broken Links # if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} # uses: peter-evans/create-issue-from-file@v4 @@ -104,10 +53,10 @@ jobs: steps: - name: Check out commit uses: actions/checkout@v4 - - name: Download all artifacts + - name: Download final build artifact uses: actions/download-artifact@v4 with: - path: artifacts + path: _build/html - name: Run Spell Checker id: spellcheck continue-on-error: true @@ -116,7 +65,7 @@ jobs: run: | mkdir -p spellcheck_reports npx -y spellchecker-cli \ - --files artifacts/**/*.html \ + --files _build/html/**/*.html \ --dictionaries .github/workflows/spellcheck_allow_list.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ --reports spellcheck_reports/spellcheck_report.json | From 91a06ec71423512e7845d0c10b6fffe42a0ab824 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 01:08:35 -0800 Subject: [PATCH 39/58] Use `lychee` to scan website file tree for broken links --- .../workflows/check-links-and-spelling.yml | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 452c743..e4375c0 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -11,41 +11,47 @@ name: Check Links and Spelling in Documentation on: - # push: { branches: [ main ] } + # FIXME: Revert the branch name here to its original value. + push: { branches: [ 61-add-link-checker ] } workflow_dispatch: { } workflow_call: { } - # pull_request: + # pull_request: # branches: [main] jobs: check-links: name: Check Links in Documentation runs-on: ubuntu-latest + permissions: + issues: write # required for peter-evans/create-issue-from-file steps: - - name: Check out commit - uses: actions/checkout@v4 - - name: Download final build artifact + - name: Get website file tree uses: actions/download-artifact@v4 with: path: _build/html - - name: Run Markdown Link Check using linkinator - id: linkcheck - # https://www.npmjs.com/package/linkinator - continue-on-error: true - # run using an npm tool - run: | - npx linkinator "_build/html/**/*.html" \ - --recurse | - tee linkcheck_reports/linkcheck_output.txt - # --verbosity DEBUG \ - # - name: Create GitHub Issue for Broken Links - # if: ${{ steps.linkcheck.outputs.links_broken == 'true' }} - # uses: peter-evans/create-issue-from-file@v4 - # with: - # title: Broken links detected in documentation - # content-filepath: linkcheck_reports/linkcheck_output.txt - # labels: documentation, broken-link + # Note: Most of this snippet was copied from https://github.com/microbiomedata/nmdc-schema/blob/9c663673f3110a31f3a54a26a0698211c42b6143/.github/workflows/check-links.yaml#L38C1-L58C45. + # A few parts were copied from https://github.com/lycheeverse/lychee-action. + - name: Use Lychee to check for broken links + # This step will populate `env.lychee_exit_code` with the exit code returned by lychee. + # Possible exit codes: https://github.com/lycheeverse/lychee?tab=readme-ov-file#exit-codes + # Reference: https://github.com/lycheeverse/lychee-action + id: lychee + uses: lycheeverse/lychee-action@v1.9.0 + with: + # Reference: https://github.com/lycheeverse/lychee#commandline-parameters + args: --base docs --verbose --no-progress --format markdown --timeout 5 '_build/html/**/*.html' + debug: true + output: ./lychee/out.md + fail: false + - name: Create GitHub Issue listing broken links + # This step will only run if lychee returned a non-zero exit code. + # Reference: https://docs.github.com/en/actions/learn-github-actions/variables#using-the-env-context-to-access-environment-variable-values + if: steps.lychee.outputs.exit_code != 0 + uses: peter-evans/create-issue-from-file@v5 + with: + title: Website file tree contains broken links + content-filepath: ./lychee/out.md check-spelling: name: Check Spelling in Documentation From 91088ff0ceffae624522c35dce2d1f11c6b15a6c Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 01:16:18 -0800 Subject: [PATCH 40/58] Configure workflow to only run when invoked by another workflow --- .github/workflows/check-links-and-spelling.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index e4375c0..732f557 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -10,13 +10,9 @@ name: Check Links and Spelling in Documentation +# Make it so this workflow only runs when called by another workflow. on: - # FIXME: Revert the branch name here to its original value. - push: { branches: [ 61-add-link-checker ] } - workflow_dispatch: { } workflow_call: { } - # pull_request: - # branches: [main] jobs: check-links: From fce879c8c3961b0cde2d67fd139554c926fcfadc Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 01:22:29 -0800 Subject: [PATCH 41/58] Specify correct website root directory to `lychee` (oops) --- .github/workflows/check-links-and-spelling.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 732f557..186d0d1 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -36,7 +36,7 @@ jobs: uses: lycheeverse/lychee-action@v1.9.0 with: # Reference: https://github.com/lycheeverse/lychee#commandline-parameters - args: --base docs --verbose --no-progress --format markdown --timeout 5 '_build/html/**/*.html' + args: --base '_build/html' --verbose --no-progress --format markdown --timeout 5 '_build/html/**/*.html' debug: true output: ./lychee/out.md fail: false From e2a393e0b76e3984e8a3fc30c7bb5f9328efbf56 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 01:29:39 -0800 Subject: [PATCH 42/58] Bump `lycheeverse/lychee-action` to version 2 --- .github/workflows/check-links-and-spelling.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 186d0d1..0332e92 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -33,10 +33,11 @@ jobs: # Possible exit codes: https://github.com/lycheeverse/lychee?tab=readme-ov-file#exit-codes # Reference: https://github.com/lycheeverse/lychee-action id: lychee - uses: lycheeverse/lychee-action@v1.9.0 + uses: lycheeverse/lychee-action@v2 with: + # Note: The `--format` option refers to the format of the report, not the documents being scanned. # Reference: https://github.com/lycheeverse/lychee#commandline-parameters - args: --base '_build/html' --verbose --no-progress --format markdown --timeout 5 '_build/html/**/*.html' + args: --base '_build/html' --verbose --no-progress --format markdown '_build/html/**/*.html' debug: true output: ./lychee/out.md fail: false From 4fcfd50933758bfad6f43d46000cd762482fa225 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 20:29:50 -0800 Subject: [PATCH 43/58] Update checker(s) workflow to depend upon `assemble-website` workflow --- .../workflows/check-links-and-spelling.yml | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 0332e92..d627776 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -1,8 +1,8 @@ ############################################################################### # Introduction: # ------------- -# This workflow builds the NMDC documentation, checks for broken links, -# and identifies any spelling errors in the documentation. +# This workflow downloads the website file tree built by a different GitHub +# Actions workflow, then checks it for broken links and for spelling errors. # If any issues are found (broken links or misspelled words), it creates # GitHub Issues containing lists of the errors for further review and fixing. # @@ -10,22 +10,39 @@ name: Check Links and Spelling in Documentation -# Make it so this workflow only runs when called by another workflow. on: + push: { branches: [ main ] } + # Run this workflow whenever someone opens or adds commits to a PR whose base branch is `main`. + # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request + pull_request: { branches: [main] } + workflow_dispatch: { } + # Allow this workflow to be called by other workflows. + # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows workflow_call: { } jobs: + # Use an existing workflow to assemble the website file tree that, in this workflow, we will scan. + # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow + assemble-website: + name: Assemble website + uses: ./.github/workflows/assemble-website.yml + check-links: name: Check Links in Documentation + needs: + - assemble-website runs-on: ubuntu-latest permissions: issues: write # required for peter-evans/create-issue-from-file steps: - name: Get website file tree - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v4 # docs: https://github.com/actions/download-artifact with: + name: github-pages path: _build/html - + # TODO: Remove this debug step. + - name: Dump the file tree + run: ls -lR _build/html # Note: Most of this snippet was copied from https://github.com/microbiomedata/nmdc-schema/blob/9c663673f3110a31f3a54a26a0698211c42b6143/.github/workflows/check-links.yaml#L38C1-L58C45. # A few parts were copied from https://github.com/lycheeverse/lychee-action. - name: Use Lychee to check for broken links @@ -52,14 +69,18 @@ jobs: check-spelling: name: Check Spelling in Documentation + needs: + - assemble-website runs-on: ubuntu-latest steps: - - name: Check out commit - uses: actions/checkout@v4 - - name: Download final build artifact - uses: actions/download-artifact@v4 + - name: Get website file tree + uses: actions/download-artifact@v4 # docs: https://github.com/actions/download-artifact with: + name: github-pages path: _build/html + # TODO: Remove this debug step. + - name: Dump the file tree + run: ls -lR _build/html - name: Run Spell Checker id: spellcheck continue-on-error: true From 559739552b447cd18d07b938e1928ea0ea3369ca Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 20:42:15 -0800 Subject: [PATCH 44/58] Untar the artifact archive into a file tree before scanning it --- .github/workflows/check-links-and-spelling.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index d627776..4b60b4c 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -39,7 +39,9 @@ jobs: uses: actions/download-artifact@v4 # docs: https://github.com/actions/download-artifact with: name: github-pages - path: _build/html + path: _downloads + - name: Untar the archive + run: tar -xvf _downloads/artifact.tar -C _build/html # TODO: Remove this debug step. - name: Dump the file tree run: ls -lR _build/html @@ -77,7 +79,9 @@ jobs: uses: actions/download-artifact@v4 # docs: https://github.com/actions/download-artifact with: name: github-pages - path: _build/html + path: _downloads + - name: Untar the archive + run: tar -xvf _downloads/artifact.tar -C _build/html # TODO: Remove this debug step. - name: Dump the file tree run: ls -lR _build/html From 1999766d88dac0622fb8f323c93c86510e9d5f7f Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 20:47:57 -0800 Subject: [PATCH 45/58] Create destination directory before using it (oops) --- .github/workflows/check-links-and-spelling.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 4b60b4c..d9a316e 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -41,7 +41,9 @@ jobs: name: github-pages path: _downloads - name: Untar the archive - run: tar -xvf _downloads/artifact.tar -C _build/html + run: | + mkdir -p _build/html + tar -xvf _downloads/artifact.tar -C _build/html # TODO: Remove this debug step. - name: Dump the file tree run: ls -lR _build/html @@ -81,7 +83,9 @@ jobs: name: github-pages path: _downloads - name: Untar the archive - run: tar -xvf _downloads/artifact.tar -C _build/html + run: | + mkdir -p _build/html + tar -xvf _downloads/artifact.tar -C _build/html # TODO: Remove this debug step. - name: Dump the file tree run: ls -lR _build/html From c1e4c6aebba96b192d4fb63b7ab79d1529552755 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 20:51:01 -0800 Subject: [PATCH 46/58] Delete obsolete config file --- .github/workflows/mlc_config.json | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .github/workflows/mlc_config.json diff --git a/.github/workflows/mlc_config.json b/.github/workflows/mlc_config.json deleted file mode 100644 index 92bb6c1..0000000 --- a/.github/workflows/mlc_config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "timeout": "20s", - "retryOn429": true, - "retryCount": 5, - "fallbackRetryDelay": "30s", - "aliveStatusCodes": [200, 206] - } \ No newline at end of file From f80ac6e4f5bb5ca598b410a8f6f0d17309707ec2 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 20:53:44 -0800 Subject: [PATCH 47/58] Check out commit so job has access to `spellcheck_allow_list.txt` --- .github/workflows/check-links-and-spelling.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index d9a316e..86f4b3b 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -44,9 +44,7 @@ jobs: run: | mkdir -p _build/html tar -xvf _downloads/artifact.tar -C _build/html - # TODO: Remove this debug step. - - name: Dump the file tree - run: ls -lR _build/html + ls -lR _build/html # Note: Most of this snippet was copied from https://github.com/microbiomedata/nmdc-schema/blob/9c663673f3110a31f3a54a26a0698211c42b6143/.github/workflows/check-links.yaml#L38C1-L58C45. # A few parts were copied from https://github.com/lycheeverse/lychee-action. - name: Use Lychee to check for broken links @@ -77,6 +75,9 @@ jobs: - assemble-website runs-on: ubuntu-latest steps: + # Check out the commit so that we have access to the "allow list" residing in the repository. + - name: Check out commit + uses: actions/checkout@v4 - name: Get website file tree uses: actions/download-artifact@v4 # docs: https://github.com/actions/download-artifact with: @@ -86,9 +87,7 @@ jobs: run: | mkdir -p _build/html tar -xvf _downloads/artifact.tar -C _build/html - # TODO: Remove this debug step. - - name: Dump the file tree - run: ls -lR _build/html + ls -lR _build/html - name: Run Spell Checker id: spellcheck continue-on-error: true From 01a709ea19a3379bd77401925187c2b92b57b118 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 20:55:22 -0800 Subject: [PATCH 48/58] Move the spellcheck allow list into new `supporting_files` subdirectory --- .github/workflows/check-links-and-spelling.yml | 2 +- .../workflows/{ => supporting_files}/spellcheck_allow_list.txt | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{ => supporting_files}/spellcheck_allow_list.txt (100%) diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-links-and-spelling.yml index 86f4b3b..209a4ea 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-links-and-spelling.yml @@ -97,7 +97,7 @@ jobs: mkdir -p spellcheck_reports npx -y spellchecker-cli \ --files _build/html/**/*.html \ - --dictionaries .github/workflows/spellcheck_allow_list.txt \ + --dictionaries .github/workflows/supporting_files/spellcheck_allow_list.txt \ --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ --reports spellcheck_reports/spellcheck_report.json | tee spellcheck_reports/spellcheck_output.txt diff --git a/.github/workflows/spellcheck_allow_list.txt b/.github/workflows/supporting_files/spellcheck_allow_list.txt similarity index 100% rename from .github/workflows/spellcheck_allow_list.txt rename to .github/workflows/supporting_files/spellcheck_allow_list.txt From 0269e8a0a4ee0b0888b8ddc2fc1637b2c74b4330 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 21:04:40 -0800 Subject: [PATCH 49/58] Separate the link check and spell check into two GHA workflows --- .github/workflows/check-links.yml | 61 +++++++++++++++++++ ...ks-and-spelling.yml => check-spelling.yml} | 58 ++---------------- 2 files changed, 65 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/check-links.yml rename .github/workflows/{check-links-and-spelling.yml => check-spelling.yml} (50%) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml new file mode 100644 index 0000000..9685949 --- /dev/null +++ b/.github/workflows/check-links.yml @@ -0,0 +1,61 @@ +# This GitHub Actions workflow finds links in HTML files and creates a GitHub Issue if any of them doesn't work. +# Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions +name: Check links + +on: + push: { branches: [ main ] } + # Run this workflow whenever someone opens or adds commits to a PR whose base branch is `main`. + # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request + pull_request: { branches: [main] } + workflow_dispatch: { } + # Allow this workflow to be called by other workflows. + # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows + workflow_call: { } + +jobs: + # Use an existing workflow to assemble the website file tree that, in this workflow, we will scan. + # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow + assemble-website: + name: Assemble website + uses: ./.github/workflows/assemble-website.yml + + check-links: + name: Check links + needs: + - assemble-website + runs-on: ubuntu-latest + permissions: + issues: write # required for peter-evans/create-issue-from-file + steps: + - name: Get website file tree + uses: actions/download-artifact@v4 # docs: https://github.com/actions/download-artifact + with: + name: github-pages + path: _downloads + - name: Untar the archive + run: | + mkdir -p _build/html + tar -xvf _downloads/artifact.tar -C _build/html + ls -lR _build/html + # Note: Most of this snippet was copied from https://github.com/microbiomedata/nmdc-schema/blob/9c663673f3110a31f3a54a26a0698211c42b6143/.github/workflows/check-links.yaml#L38C1-L58C45. + # A few parts were copied from https://github.com/lycheeverse/lychee-action. + - name: Use Lychee to check for broken links + # This step will populate `steps.lychee.outputs.exit_code` with the exit code returned by lychee. + # Reference: https://github.com/lycheeverse/lychee-action + id: lychee + uses: lycheeverse/lychee-action@v2 + with: + # Note: The `--format` option refers to the format of the report, not the documents being scanned. + # Reference: https://github.com/lycheeverse/lychee#commandline-parameters + args: --base '_build/html' --verbose --no-progress --format markdown '_build/html/**/*.html' + debug: true + output: ./lychee/out.md + fail: false + - name: Create GitHub Issue listing broken links + # This step will only run if lychee returned a non-zero exit code. + # Reference: https://docs.github.com/en/actions/learn-github-actions/variables#using-the-env-context-to-access-environment-variable-values + if: steps.lychee.outputs.exit_code != 0 + uses: peter-evans/create-issue-from-file@v5 + with: + title: Website file tree contains broken links + content-filepath: ./lychee/out.md diff --git a/.github/workflows/check-links-and-spelling.yml b/.github/workflows/check-spelling.yml similarity index 50% rename from .github/workflows/check-links-and-spelling.yml rename to .github/workflows/check-spelling.yml index 209a4ea..38403a0 100644 --- a/.github/workflows/check-links-and-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -1,14 +1,6 @@ -############################################################################### -# Introduction: -# ------------- -# This workflow downloads the website file tree built by a different GitHub -# Actions workflow, then checks it for broken links and for spelling errors. -# If any issues are found (broken links or misspelled words), it creates -# GitHub Issues containing lists of the errors for further review and fixing. -# -############################################################################### - -name: Check Links and Spelling in Documentation +# This GitHub Actions workflow checks spelling in HTML files and creates a GitHub Issue if it finds misspelled words. +# Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions +name: Check spelling on: push: { branches: [ main ] } @@ -27,50 +19,8 @@ jobs: name: Assemble website uses: ./.github/workflows/assemble-website.yml - check-links: - name: Check Links in Documentation - needs: - - assemble-website - runs-on: ubuntu-latest - permissions: - issues: write # required for peter-evans/create-issue-from-file - steps: - - name: Get website file tree - uses: actions/download-artifact@v4 # docs: https://github.com/actions/download-artifact - with: - name: github-pages - path: _downloads - - name: Untar the archive - run: | - mkdir -p _build/html - tar -xvf _downloads/artifact.tar -C _build/html - ls -lR _build/html - # Note: Most of this snippet was copied from https://github.com/microbiomedata/nmdc-schema/blob/9c663673f3110a31f3a54a26a0698211c42b6143/.github/workflows/check-links.yaml#L38C1-L58C45. - # A few parts were copied from https://github.com/lycheeverse/lychee-action. - - name: Use Lychee to check for broken links - # This step will populate `env.lychee_exit_code` with the exit code returned by lychee. - # Possible exit codes: https://github.com/lycheeverse/lychee?tab=readme-ov-file#exit-codes - # Reference: https://github.com/lycheeverse/lychee-action - id: lychee - uses: lycheeverse/lychee-action@v2 - with: - # Note: The `--format` option refers to the format of the report, not the documents being scanned. - # Reference: https://github.com/lycheeverse/lychee#commandline-parameters - args: --base '_build/html' --verbose --no-progress --format markdown '_build/html/**/*.html' - debug: true - output: ./lychee/out.md - fail: false - - name: Create GitHub Issue listing broken links - # This step will only run if lychee returned a non-zero exit code. - # Reference: https://docs.github.com/en/actions/learn-github-actions/variables#using-the-env-context-to-access-environment-variable-values - if: steps.lychee.outputs.exit_code != 0 - uses: peter-evans/create-issue-from-file@v5 - with: - title: Website file tree contains broken links - content-filepath: ./lychee/out.md - check-spelling: - name: Check Spelling in Documentation + name: Check spelling needs: - assemble-website runs-on: ubuntu-latest From 6e733eaac6f9e911554824d35f40756c1b4cfa2d Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 21:11:51 -0800 Subject: [PATCH 50/58] Clarify step name --- .github/workflows/check-spelling.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index 38403a0..4e15a73 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -38,7 +38,7 @@ jobs: mkdir -p _build/html tar -xvf _downloads/artifact.tar -C _build/html ls -lR _build/html - - name: Run Spell Checker + - name: Run Spellchecker CLI id: spellcheck continue-on-error: true # Source: https://github.com/tbroadley/spellchecker-cli and https://github.com/austenstone/spellchecker-cli-action-summary From b0bd7520d487b334c418713044c622a4b70971fd Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 21:32:48 -0800 Subject: [PATCH 51/58] Invoke `spellchecker-cli` via off-the-shelf action instead of via `npx` --- .github/workflows/check-spelling.yml | 43 ++++++++++++---------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index 4e15a73..9d3d578 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -38,29 +38,22 @@ jobs: mkdir -p _build/html tar -xvf _downloads/artifact.tar -C _build/html ls -lR _build/html - - name: Run Spellchecker CLI - id: spellcheck + - name: Run Spellchecker CLI (action) + id: spellchecker-cli + uses: tbroadley/spellchecker-cli-action@v1 # docs: https://github.com/marketplace/actions/spellchecker-cli continue-on-error: true - # Source: https://github.com/tbroadley/spellchecker-cli and https://github.com/austenstone/spellchecker-cli-action-summary - # Based off: https://github.com/austenstone/spellchecker-cli-action-summary/blob/main/.github/workflows/spellcheck.yml - run: | - mkdir -p spellcheck_reports - npx -y spellchecker-cli \ - --files _build/html/**/*.html \ - --dictionaries .github/workflows/supporting_files/spellcheck_allow_list.txt \ - --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \ - --reports spellcheck_reports/spellcheck_report.json | - tee spellcheck_reports/spellcheck_output.txt - if grep -q 'misspelt' spellcheck_reports/spellcheck_report.json; then - echo "misspelt=true" >> $GITHUB_OUTPUT - else - echo "misspelt=false" >> $GITHUB_OUTPUT - fi - - # - name: Create GitHub Issue for Misspellings - # if: ${{ steps.spellcheck.outputs.misspelt == 'true' }} - # uses: peter-evans/create-issue-from-file@v4 - # with: - # title: Documentation contains misspelled words - # content-filepath: spellcheck_reports/spellcheck_output.txt - # labels: documentation, spelling-error \ No newline at end of file + with: + files: _build/html/**/*.html + dictionaries: .github/workflows/supporting_files/spellcheck_allow_list.txt + plugins: spell indefinite-article repeated-words syntax-mentions syntax-urls + reports: spellcheck_reports/spellcheck_report.json + - name: Dump spell check report + run: cat spellcheck_reports/spellcheck_report.json + # Use "Spellchecker CLI Summary" to report the spelling errors on GitHub. + # Reference: https://github.com/austenstone/spellchecker-cli-action-summary + - name: Report spelling errors + uses: austenstone/spellchecker-cli-action-summary@v1.0 + with: + file-json: spellcheck_reports/spellcheck_report.json + # TODO: Be more specific about which files have changed. + files-changed: _build/html/**/*.html From 9f306408439c11042856846eeb034594fb51ee84 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 22:41:40 -0800 Subject: [PATCH 52/58] Trigger checker workflows from assembler workflow (instead of opposite) --- .github/workflows/assemble-website.yml | 17 +++++++++++++++++ .github/workflows/check-links.yml | 13 ------------- .github/workflows/check-spelling.yml | 13 ------------- .github/workflows/deploy-to-gh-pages.yml | 4 ++++ 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/.github/workflows/assemble-website.yml b/.github/workflows/assemble-website.yml index eb19a54..a08a2fd 100644 --- a/.github/workflows/assemble-website.yml +++ b/.github/workflows/assemble-website.yml @@ -3,6 +3,11 @@ name: Assemble website on: + # Run this workflow whenever someone opens or adds commits to a PR whose base branch is `main`. + # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request + pull_request: { branches: [ main ] } + # Allow this workflow to be run manually (e.g., via the "Actions" tab on GitHub). + # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_dispatch workflow_dispatch: { } # Allow this workflow to be called by other workflows. # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows @@ -61,3 +66,15 @@ jobs: # anyway, here, as a reminder for people that will be implementing workflows that consume the same # artifact; e.g., spell checkers and link checkers. name: github-pages + + # Use existing workflows to check the file tree for broken links and spelling errors. + check-links: + name: Check links + uses: ./.github/workflows/check-links.yml + needs: + - assemble + check-spelling: + name: Check spelling + uses: ./.github/workflows/check-spelling.yml + needs: + - assemble diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 9685949..6689aa5 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -3,26 +3,13 @@ name: Check links on: - push: { branches: [ main ] } - # Run this workflow whenever someone opens or adds commits to a PR whose base branch is `main`. - # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request - pull_request: { branches: [main] } - workflow_dispatch: { } # Allow this workflow to be called by other workflows. # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows workflow_call: { } jobs: - # Use an existing workflow to assemble the website file tree that, in this workflow, we will scan. - # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow - assemble-website: - name: Assemble website - uses: ./.github/workflows/assemble-website.yml - check-links: name: Check links - needs: - - assemble-website runs-on: ubuntu-latest permissions: issues: write # required for peter-evans/create-issue-from-file diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index 9d3d578..41c0c13 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -3,26 +3,13 @@ name: Check spelling on: - push: { branches: [ main ] } - # Run this workflow whenever someone opens or adds commits to a PR whose base branch is `main`. - # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request - pull_request: { branches: [main] } - workflow_dispatch: { } # Allow this workflow to be called by other workflows. # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows workflow_call: { } jobs: - # Use an existing workflow to assemble the website file tree that, in this workflow, we will scan. - # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow - assemble-website: - name: Assemble website - uses: ./.github/workflows/assemble-website.yml - check-spelling: name: Check spelling - needs: - - assemble-website runs-on: ubuntu-latest steps: # Check out the commit so that we have access to the "allow list" residing in the repository. diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml index 841ccb3..2af60d0 100644 --- a/.github/workflows/deploy-to-gh-pages.yml +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -3,7 +3,11 @@ name: Deploy to GitHub Pages on: + # Run this workflow whenever someone pushes commits or tags to the `main` branch. + # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#push push: { branches: [ main ] } + # Allow this workflow to be run manually (e.g., via the "Actions" tab on GitHub). + # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_dispatch workflow_dispatch: { } # Reference: https://docs.github.com/en/actions/using-jobs/using-concurrency From 6797ef102a37b66aff5415e71d96c76e76f0d5cf Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 22:45:00 -0800 Subject: [PATCH 53/58] Avoid compiling home docs multiple times per PR update --- .github/workflows/compile-home-docs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/compile-home-docs.yml b/.github/workflows/compile-home-docs.yml index 65ed5f0..482b9a1 100644 --- a/.github/workflows/compile-home-docs.yml +++ b/.github/workflows/compile-home-docs.yml @@ -3,10 +3,8 @@ name: Compile home documentation into HTML on: - push: { branches: [ main ] } # Run this workflow whenever someone opens or adds commits to a PR whose base branch is `main`. # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request - pull_request: { branches: [main] } workflow_dispatch: { } # Allow this workflow to be called by other workflows. # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows From fe43af5e009eb916db78f10a7284c5723a0ee991 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 23:02:50 -0800 Subject: [PATCH 54/58] Bump `spellchecker-cli-action` to latest version --- .github/workflows/check-spelling.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index 41c0c13..e449ebc 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -27,9 +27,11 @@ jobs: ls -lR _build/html - name: Run Spellchecker CLI (action) id: spellchecker-cli - uses: tbroadley/spellchecker-cli-action@v1 # docs: https://github.com/marketplace/actions/spellchecker-cli + uses: tbroadley/spellchecker-cli-action@v1.1.1 # docs: https://github.com/marketplace/actions/spellchecker-cli?version=v1.1.1 continue-on-error: true with: + # Note: The Spellchecker CLI uses Globby to resolve these patterns. + # Reference: https://github.com/tbroadley/spellchecker-cli?tab=readme-ov-file#globs files: _build/html/**/*.html dictionaries: .github/workflows/supporting_files/spellcheck_allow_list.txt plugins: spell indefinite-article repeated-words syntax-mentions syntax-urls From 693cfb54a9bfd9fa9d19180b19aba93a8cb56fbc Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 23:06:33 -0800 Subject: [PATCH 55/58] Create directory before using it --- .github/workflows/check-spelling.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index e449ebc..171223f 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -25,7 +25,9 @@ jobs: mkdir -p _build/html tar -xvf _downloads/artifact.tar -C _build/html ls -lR _build/html - - name: Run Spellchecker CLI (action) + - name: Create directory for report + run: mkdir -p _spellcheck_reports + - name: Run Spellchecker CLI id: spellchecker-cli uses: tbroadley/spellchecker-cli-action@v1.1.1 # docs: https://github.com/marketplace/actions/spellchecker-cli?version=v1.1.1 continue-on-error: true @@ -35,14 +37,14 @@ jobs: files: _build/html/**/*.html dictionaries: .github/workflows/supporting_files/spellcheck_allow_list.txt plugins: spell indefinite-article repeated-words syntax-mentions syntax-urls - reports: spellcheck_reports/spellcheck_report.json + reports: _spellcheck_reports/spellcheck_report.json - name: Dump spell check report - run: cat spellcheck_reports/spellcheck_report.json + run: cat _spellcheck_reports/spellcheck_report.json # Use "Spellchecker CLI Summary" to report the spelling errors on GitHub. # Reference: https://github.com/austenstone/spellchecker-cli-action-summary - name: Report spelling errors uses: austenstone/spellchecker-cli-action-summary@v1.0 with: - file-json: spellcheck_reports/spellcheck_report.json + file-json: _spellcheck_reports/spellcheck_report.json # TODO: Be more specific about which files have changed. files-changed: _build/html/**/*.html From 1412bbd2cb1ed98ca2377f67aa2a0813ea7ea7db Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 23:26:04 -0800 Subject: [PATCH 56/58] Only create GitHub Issue about broken links if processing `main` branch --- .github/workflows/check-links.yml | 8 +++----- .github/workflows/check-spelling.yml | 2 +- .github/workflows/compile-home-docs.yml | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 6689aa5..6fba3e2 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -19,13 +19,11 @@ jobs: with: name: github-pages path: _downloads - - name: Untar the archive + - name: Un-tar the archive run: | mkdir -p _build/html tar -xvf _downloads/artifact.tar -C _build/html ls -lR _build/html - # Note: Most of this snippet was copied from https://github.com/microbiomedata/nmdc-schema/blob/9c663673f3110a31f3a54a26a0698211c42b6143/.github/workflows/check-links.yaml#L38C1-L58C45. - # A few parts were copied from https://github.com/lycheeverse/lychee-action. - name: Use Lychee to check for broken links # This step will populate `steps.lychee.outputs.exit_code` with the exit code returned by lychee. # Reference: https://github.com/lycheeverse/lychee-action @@ -39,9 +37,9 @@ jobs: output: ./lychee/out.md fail: false - name: Create GitHub Issue listing broken links - # This step will only run if lychee returned a non-zero exit code. + # This step will only run if both (a) lychee returned a non-zero exit code and (b) we are on the `main` branch. # Reference: https://docs.github.com/en/actions/learn-github-actions/variables#using-the-env-context-to-access-environment-variable-values - if: steps.lychee.outputs.exit_code != 0 + if: steps.lychee.outputs.exit_code != 0 && github.ref == 'refs/heads/main' uses: peter-evans/create-issue-from-file@v5 with: title: Website file tree contains broken links diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index 171223f..99e0756 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -20,7 +20,7 @@ jobs: with: name: github-pages path: _downloads - - name: Untar the archive + - name: Un-tar the archive run: | mkdir -p _build/html tar -xvf _downloads/artifact.tar -C _build/html diff --git a/.github/workflows/compile-home-docs.yml b/.github/workflows/compile-home-docs.yml index 482b9a1..1c51d2b 100644 --- a/.github/workflows/compile-home-docs.yml +++ b/.github/workflows/compile-home-docs.yml @@ -3,8 +3,8 @@ name: Compile home documentation into HTML on: - # Run this workflow whenever someone opens or adds commits to a PR whose base branch is `main`. - # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request + # Allow this workflow to be run manually (e.g., via the "Actions" tab on GitHub). + # Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_dispatch workflow_dispatch: { } # Allow this workflow to be called by other workflows. # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows From 3c6ee679c480751a89bca568d0588cf90170e892 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 29 Jan 2025 23:34:56 -0800 Subject: [PATCH 57/58] Dump path of working directory (for debug) --- .github/workflows/check-links.yml | 1 + .github/workflows/check-spelling.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 6fba3e2..db121f4 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -21,6 +21,7 @@ jobs: path: _downloads - name: Un-tar the archive run: | + pwd mkdir -p _build/html tar -xvf _downloads/artifact.tar -C _build/html ls -lR _build/html diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index 99e0756..fd0a423 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -22,6 +22,7 @@ jobs: path: _downloads - name: Un-tar the archive run: | + pwd mkdir -p _build/html tar -xvf _downloads/artifact.tar -C _build/html ls -lR _build/html From dfa542729589918b89c355e9a353ff490612bc9b Mon Sep 17 00:00:00 2001 From: eecavanna Date: Wed, 5 Feb 2025 12:47:50 -0800 Subject: [PATCH 58/58] Delete preliminary spell checking GHA workflow and supporting files --- .github/workflows/assemble-website.yml | 7 +-- .github/workflows/check-spelling.yml | 51 ------------------- .../spellcheck_allow_list.txt | 36 ------------- 3 files changed, 1 insertion(+), 93 deletions(-) delete mode 100644 .github/workflows/check-spelling.yml delete mode 100644 .github/workflows/supporting_files/spellcheck_allow_list.txt diff --git a/.github/workflows/assemble-website.yml b/.github/workflows/assemble-website.yml index a08a2fd..da6d4ef 100644 --- a/.github/workflows/assemble-website.yml +++ b/.github/workflows/assemble-website.yml @@ -67,14 +67,9 @@ jobs: # artifact; e.g., spell checkers and link checkers. name: github-pages - # Use existing workflows to check the file tree for broken links and spelling errors. + # Use existing workflow(s) to check the file tree for broken links. check-links: name: Check links uses: ./.github/workflows/check-links.yml needs: - assemble - check-spelling: - name: Check spelling - uses: ./.github/workflows/check-spelling.yml - needs: - - assemble diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml deleted file mode 100644 index fd0a423..0000000 --- a/.github/workflows/check-spelling.yml +++ /dev/null @@ -1,51 +0,0 @@ -# This GitHub Actions workflow checks spelling in HTML files and creates a GitHub Issue if it finds misspelled words. -# Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions -name: Check spelling - -on: - # Allow this workflow to be called by other workflows. - # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows - workflow_call: { } - -jobs: - check-spelling: - name: Check spelling - runs-on: ubuntu-latest - steps: - # Check out the commit so that we have access to the "allow list" residing in the repository. - - name: Check out commit - uses: actions/checkout@v4 - - name: Get website file tree - uses: actions/download-artifact@v4 # docs: https://github.com/actions/download-artifact - with: - name: github-pages - path: _downloads - - name: Un-tar the archive - run: | - pwd - mkdir -p _build/html - tar -xvf _downloads/artifact.tar -C _build/html - ls -lR _build/html - - name: Create directory for report - run: mkdir -p _spellcheck_reports - - name: Run Spellchecker CLI - id: spellchecker-cli - uses: tbroadley/spellchecker-cli-action@v1.1.1 # docs: https://github.com/marketplace/actions/spellchecker-cli?version=v1.1.1 - continue-on-error: true - with: - # Note: The Spellchecker CLI uses Globby to resolve these patterns. - # Reference: https://github.com/tbroadley/spellchecker-cli?tab=readme-ov-file#globs - files: _build/html/**/*.html - dictionaries: .github/workflows/supporting_files/spellcheck_allow_list.txt - plugins: spell indefinite-article repeated-words syntax-mentions syntax-urls - reports: _spellcheck_reports/spellcheck_report.json - - name: Dump spell check report - run: cat _spellcheck_reports/spellcheck_report.json - # Use "Spellchecker CLI Summary" to report the spelling errors on GitHub. - # Reference: https://github.com/austenstone/spellchecker-cli-action-summary - - name: Report spelling errors - uses: austenstone/spellchecker-cli-action-summary@v1.0 - with: - file-json: _spellcheck_reports/spellcheck_report.json - # TODO: Be more specific about which files have changed. - files-changed: _build/html/**/*.html diff --git a/.github/workflows/supporting_files/spellcheck_allow_list.txt b/.github/workflows/supporting_files/spellcheck_allow_list.txt deleted file mode 100644 index 7078e87..0000000 --- a/.github/workflows/supporting_files/spellcheck_allow_list.txt +++ /dev/null @@ -1,36 +0,0 @@ -Bioinformatics -bioinformatics -Biosample -biosample -Changesheets -changesheets -Community-centric -community-centric -Diátaxis -Globus -IMG -JSON -json -Lipidomics -lipidomics -Metabolomics -metabolomics -MetaG -Metagenome -metagenome -Metagenomic -metagenomic -Metaproteomic -MetaT -Metatranscriptome -metatranscriptome -Metatranscriptomic -metatranscriptomic -Microbiome -microbiome -Mgt -MkDocs -multi-omics -NMDC -NMDC's -nmdc-runtime \ No newline at end of file