mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2024-11-28 08:38:51 +02:00
Update Link Checking and Markdown Linting Workflows (#2795)
* Add full docs check workflow * Rename file * Remove on pull requests trigger Only run on merge to main and daily at 9am. * Refactor link and markdown lint workflows * Add lycheeignore * Unify link check job name * Remove markdown-link config Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
This commit is contained in:
parent
8574d43509
commit
e8fbfd3ec5
16
.github/workflows/links-fail-fast.yml
vendored
Normal file
16
.github/workflows/links-fail-fast.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: Links (Fail Fast)
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check-links:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Link Checker
|
||||
uses: lycheeverse/lychee-action@v1.4.1
|
||||
with:
|
||||
fail: true
|
27
.github/workflows/links.yml
vendored
Normal file
27
.github/workflows/links.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
name: Links
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Everyday at 9:00 AM.
|
||||
- cron: "0 9 * * *"
|
||||
|
||||
jobs:
|
||||
check-links:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Link Checker
|
||||
id: lychee
|
||||
uses: lycheeverse/lychee-action@v1.4.1
|
||||
|
||||
- name: Create Issue From File
|
||||
if: steps.lychee.outputs.exit_code != 0
|
||||
uses: peter-evans/create-issue-from-file@v3
|
||||
with:
|
||||
title: Link Checker Report
|
||||
content-filepath: ./lychee/out.md
|
||||
labels: report, bot-generated
|
34
.github/workflows/markdown-fail-fast.yml
vendored
Normal file
34
.github/workflows/markdown-fail-fast.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
name: Markdown (Fail Fast)
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
changedfiles:
|
||||
name: changed files
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
md: ${{ steps.changes.outputs.md }}
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
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@v3
|
||||
- name: Run linter
|
||||
uses: docker://avtodev/markdown-lint:v1
|
||||
with:
|
||||
args: ${{needs.changedfiles.outputs.md}}
|
70
.github/workflows/markdown.yml
vendored
70
.github/workflows/markdown.yml
vendored
@ -1,57 +1,31 @@
|
||||
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@v3
|
||||
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)"
|
||||
name: Markdown
|
||||
|
||||
lint:
|
||||
name: lint markdown files
|
||||
on:
|
||||
repository_dispatch:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Everyday at 9:00 AM.
|
||||
- cron: "0 9 * * *"
|
||||
|
||||
jobs:
|
||||
lint-markdown:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changedfiles
|
||||
if: ${{needs.changedfiles.outputs.md}}
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run linter
|
||||
id: markdownlint
|
||||
uses: docker://avtodev/markdown-lint:v1
|
||||
with:
|
||||
args: ${{needs.changedfiles.outputs.md}}
|
||||
config: .markdownlint.yaml
|
||||
args: '**/*.md'
|
||||
output: ./markdownlint.txt
|
||||
|
||||
check-links:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changedfiles
|
||||
if: ${{needs.changedfiles.outputs.md}}
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# This doesn't use gaurav-nelson/github-action-markdown-link-check
|
||||
# intentionally. As of v1.0.13 the base image was not pinned to a LTS
|
||||
# version of node and updates upstream to the base image caused CI
|
||||
# failures. This boils down the entrypoint script from that repository
|
||||
# and calls markdown-link-check directly instead.
|
||||
- name: Install markdown-link-check
|
||||
run: npm install -g markdown-link-check
|
||||
- name: Run markdown-link-check
|
||||
run: |
|
||||
markdown-link-check \
|
||||
--verbose \
|
||||
--config .markdown-link.json \
|
||||
${{needs.changedfiles.outputs.md}}
|
||||
- name: Create Issue From File
|
||||
if: steps.markdownlint.outputs.exit_code != 0
|
||||
uses: peter-evans/create-issue-from-file@v3
|
||||
with:
|
||||
title: Markdown Lint Report
|
||||
content-filepath: ./markdownlint.txt
|
||||
labels: report, bot-generated
|
||||
|
2
.lycheeignore
Normal file
2
.lycheeignore
Normal file
@ -0,0 +1,2 @@
|
||||
http://localhost
|
||||
http://jaeger-collector
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
"ignorePatterns": [
|
||||
{
|
||||
"pattern": "^http(s)?://localhost"
|
||||
}
|
||||
],
|
||||
"replacementPatterns": [
|
||||
{
|
||||
"pattern": "^/registry",
|
||||
"replacement": "https://opentelemetry.io/registry"
|
||||
},
|
||||
{
|
||||
"pattern": "^/docs/",
|
||||
"replacement": "https://opentelemetry.io/docs/"
|
||||
}
|
||||
],
|
||||
"retryOn429": true,
|
||||
"retryCount": 5,
|
||||
"fallbackRetryDelay": "30s"
|
||||
}
|
Loading…
Reference in New Issue
Block a user