1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-12 10:04:29 +02:00
opentelemetry-go/.github/workflows/markdown.yml
Tyler Yahn f40cad5ee2
Add markdown link check configuration and action (#1869)
* Add Markdown link check

* Add replacement for registry URL and clean ignored

* Fix config file name

* Update .markdown-link.json

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-05-02 07:15:42 -07:00

51 lines
1.3 KiB
YAML

name: markdown
on:
push:
branches:
- main
pull_request:
jobs:
changedfiles:
name: changed files
runs-on: ubuntu-latest
outputs:
md: ${{ steps.changes.outputs.md }}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get changed files
id: changes
run: |
echo "::set-output name=md::$(git diff --name-only --diff-filter=ACMRTUXB origin/${{ github.event.pull_request.base.ref }} ${{ github.event.pull_request.head.sha }} | grep .md$ | xargs)"
lint:
name: lint markdown files
runs-on: ubuntu-latest
needs: changedfiles
if: ${{needs.changedfiles.outputs.md}}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Run linter
uses: docker://avtodev/markdown-lint:v1
with:
args: ${{needs.changedfiles.outputs.md}}
check-links:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
base-branch: 'main'
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: '.markdown-link.json'
check-modified-files-only: 'yes'
folder-path: ''