You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +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:
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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}}
|
||||||
@@ -1,57 +1,31 @@
|
|||||||
name: markdown
|
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)"
|
|
||||||
|
|
||||||
lint:
|
on:
|
||||||
name: lint markdown files
|
repository_dispatch:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
# Everyday at 9:00 AM.
|
||||||
|
- cron: "0 9 * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-markdown:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: changedfiles
|
|
||||||
if: ${{needs.changedfiles.outputs.md}}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Run linter
|
- name: Run linter
|
||||||
|
id: markdownlint
|
||||||
uses: docker://avtodev/markdown-lint:v1
|
uses: docker://avtodev/markdown-lint:v1
|
||||||
with:
|
with:
|
||||||
args: ${{needs.changedfiles.outputs.md}}
|
config: .markdownlint.yaml
|
||||||
|
args: '**/*.md'
|
||||||
|
output: ./markdownlint.txt
|
||||||
|
|
||||||
check-links:
|
- name: Create Issue From File
|
||||||
runs-on: ubuntu-latest
|
if: steps.markdownlint.outputs.exit_code != 0
|
||||||
needs: changedfiles
|
uses: peter-evans/create-issue-from-file@v3
|
||||||
if: ${{needs.changedfiles.outputs.md}}
|
with:
|
||||||
steps:
|
title: Markdown Lint Report
|
||||||
- name: Checkout Repo
|
content-filepath: ./markdownlint.txt
|
||||||
uses: actions/checkout@v3
|
labels: report, bot-generated
|
||||||
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}}
|
|
||||||
|
|||||||
@@ -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"
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user