From 691ddc7103f5f09155951b88a9cf526519230e7c Mon Sep 17 00:00:00 2001 From: anissa111 Date: Fri, 12 Jan 2024 12:40:37 -0700 Subject: [PATCH 1/3] add required sections to linkcheck workflow file --- .github/workflows/link-chcker.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/link-chcker.yaml b/.github/workflows/link-chcker.yaml index c31100a..25ffc4e 100644 --- a/.github/workflows/link-chcker.yaml +++ b/.github/workflows/link-chcker.yaml @@ -1,3 +1,12 @@ +name: link-checker + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + jobs: link-checker: runs-on: ubuntu-latest From aea68ac2e671e885549234b00e2246dfb4e15e95 Mon Sep 17 00:00:00 2001 From: anissa111 Date: Fri, 12 Jan 2024 12:58:46 -0700 Subject: [PATCH 2/3] try going back to org trigger --- .github/workflows/link-chcker.yaml | 49 ----------------------- .github/workflows/trigger-link-check.yaml | 4 +- 2 files changed, 3 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/link-chcker.yaml diff --git a/.github/workflows/link-chcker.yaml b/.github/workflows/link-chcker.yaml deleted file mode 100644 index 25ffc4e..0000000 --- a/.github/workflows/link-chcker.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: link-checker - -on: - push: - branches: - - main - pull_request: - workflow_dispatch: - -jobs: - link-checker: - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - steps: - - uses: actions/checkout@v4 - - - name: Setup Mambaforge - uses: conda-incubator/setup-miniconda@v3 - with: - miniforge-variant: Mambaforge - miniforge-version: latest - use-mamba: true - - - name: Install Jupyterbook - run: mamba install -c conda-forge jupyter-book - - - name: Check for config file - id: check_config - uses: andstor/file-existence-action@v2 - with: - files: "${{ inputs.path_to_notebooks }}/_config.yml" - - - name: Disable notebook execution - if: steps.check_config.outputs.files_exists == 'true' - shell: python - run: | - import yaml - with open('${{ inputs.path_to_notebooks }}/_config.yml') as f: - data = yaml.safe_load(f) - data['execute']['execute_notebooks'] = 'off' - with open('${{ inputs.path_to_notebooks }}/_config.yml', 'w') as f: - yaml.dump(data, f) - - - name: Check external links - run: | - cd ${{ inputs.path_to_notebooks }} - linkchecker --ignore-url "https://www.noaa.gov/jetstream" --ignore-url "https://weather.uwyo.edu/upperair/" --ignore-ssl-check ${{ inputs.build_command }} diff --git a/.github/workflows/trigger-link-check.yaml b/.github/workflows/trigger-link-check.yaml index d8812eb..c785dc8 100644 --- a/.github/workflows/trigger-link-check.yaml +++ b/.github/workflows/trigger-link-check.yaml @@ -4,4 +4,6 @@ on: jobs: link-check: - uses: /.github/workflows/link-checker.yaml@main + uses: ProjectPythia/cookbook-actions/.github/workflows/link-checker.yaml@main + with: + build_command: "jupyter-book build --builder linkcheck SPHINXOPTS=linkcheck_ignore=['https://weather.uwyo.edu/upperair/', 'https://www.noaa.gov/jetstream'] ." \ No newline at end of file From f18960072e88545423f08164156b86d8cedb62bc Mon Sep 17 00:00:00 2001 From: anissa111 Date: Fri, 12 Jan 2024 13:25:21 -0700 Subject: [PATCH 3/3] add ignores to _ocnfig.yml --- .github/workflows/trigger-link-check.yaml | 2 -- _config.yml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/trigger-link-check.yaml b/.github/workflows/trigger-link-check.yaml index c785dc8..e2402dd 100644 --- a/.github/workflows/trigger-link-check.yaml +++ b/.github/workflows/trigger-link-check.yaml @@ -5,5 +5,3 @@ on: jobs: link-check: uses: ProjectPythia/cookbook-actions/.github/workflows/link-checker.yaml@main - with: - build_command: "jupyter-book build --builder linkcheck SPHINXOPTS=linkcheck_ignore=['https://weather.uwyo.edu/upperair/', 'https://www.noaa.gov/jetstream'] ." \ No newline at end of file diff --git a/_config.yml b/_config.yml index 43bbbe5..e381513 100644 --- a/_config.yml +++ b/_config.yml @@ -28,7 +28,7 @@ parse: sphinx: config: - linkcheck_ignore: ["https://doi.org/*"] # don't run link checker on DOI links since they are immutable + linkcheck_ignore: ["https://doi.org/*", "https://www.noaa.gov/*", "https://weather.uwyo.edu/*"] # don't run link checker on DOI links since they are immutable nb_execution_raise_on_error: true # raise exception in build if there are notebook errors (this flag is ignored if building on binder) html_favicon: notebooks/images/icons/favicon.ico html_last_updated_fmt: "%-d %B %Y"