Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added checking markdown links #81

Merged
merged 17 commits into from
Mar 6, 2023
15 changes: 15 additions & 0 deletions .github/markdown.links.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"ignorePatterns": [
{
"pattern": "^https://github.com/Lightning-AI/lightning/pull/.*"
}
],
"httpHeaders": [
{
"urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
]
}
49 changes: 49 additions & 0 deletions .github/workflows/check-md-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Check Markdown links
# https://github.com/gaurav-nelson/github-action-markdown-link-check

on:
workflow_call:
inputs:
config-file:
description: 'Config file (JSON) used for markdown link checks'
required: false
type: string
default: ''

jobs:
markdown-link-check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master

- name: Create local version of config
if: inputs.config-file == ''
run: |
echo '{
"ignorePatterns": [
{
"pattern": "^https://github.com/${{ github.repository }}/pull/.*"
}
],
"httpHeaders": [
{
"urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
]
}' > 'markdown.links.config.json'
echo "CONFIG=markdown.links.config.json" >> $GITHUB_ENV
cat 'markdown.links.config.json'
- name: Show local version of config
if: inputs.config-file != ''
run: |
echo "CONFIG=${{ inputs.config-file }}" >> $GITHUB_ENV
cat ${{ inputs.config-file }}

- name: Checking markdown link
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
config-file: ${{ env.CONFIG }}
5 changes: 5 additions & 0 deletions .github/workflows/ci-use-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ jobs:

check-docs:
uses: ./.github/workflows/check-docs.yml

check-md-links:
uses: ./.github/workflows/check-md-links.yml
#with:
# config-file: ".github/markdown.links.config.json"
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added requirements parser ([#107](https://github.com/Lightning-AI/utilities/pull/107))


- Added workflow for checking markdown links ([#81](https://github.com/Lightning-AI/utilities/pull/81))


-


Expand Down Expand Up @@ -46,9 +52,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Extended `StrEnum.from_str` with optional raising ValueError ([#99](https://github.com/Lightning-AI/utilities/pull/99))


- Added requirements parser ([#107](https://github.com/Lightning-AI/utilities/pull/107))


### Changed

- CI/docs: allow passing env. variables ([#96](https://github.com/Lightning-AI/utilities/pull/96))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![UnitTests](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml/badge.svg?event=push)](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml)
[![Apply checks](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yaml/badge.svg?event=push)](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yaml)
[![Documentation Status](https://readthedocs.org/projects/lightning_utilities/badge/?version=latest)](https://lightning-tools.readthedocs.io/en/latest/?badge=latest)
[![Docs Status](https://readthedocs.org/projects/lit-utilities/badge/?version=latest)](https://lit-utilities.readthedocs.io/en/latest/?badge=latest)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Lightning-AI/utilities/main.svg)](https://results.pre-commit.ci/latest/github/Lightning-AI/utilities/main)

__This repository covers the following use-cases:__
Expand Down