diff --git a/.github/workflows/links-fail-fast.yml b/.github/workflows/links-fail-fast.yml new file mode 100644 index 00000000000..86847617c84 --- /dev/null +++ b/.github/workflows/links-fail-fast.yml @@ -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 diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml new file mode 100644 index 00000000000..74b7982b81e --- /dev/null +++ b/.github/workflows/links.yml @@ -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 diff --git a/.github/workflows/markdown-fail-fast.yml b/.github/workflows/markdown-fail-fast.yml new file mode 100644 index 00000000000..bcfb0dedaca --- /dev/null +++ b/.github/workflows/markdown-fail-fast.yml @@ -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}} diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml index 92a8b8727a9..b568bdceab5 100644 --- a/.github/workflows/markdown.yml +++ b/.github/workflows/markdown.yml @@ -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)" + repository_dispatch: + workflow_dispatch: + schedule: + # Everyday at 9:00 AM. + - cron: "0 9 * * *" - lint: - name: lint markdown files +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 diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 00000000000..d300b3f801f --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,2 @@ +http://localhost +http://jaeger-collector diff --git a/.markdown-link.json b/.markdown-link.json deleted file mode 100644 index bd786f03c15..00000000000 --- a/.markdown-link.json +++ /dev/null @@ -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" -}