Skip to content

Commit

Permalink
Merge branch 'main' into vanity-import-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias authored Apr 20, 2022
2 parents 52752d8 + e8fbfd3 commit eb003e2
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 67 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/links-fail-fast.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 27 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 34 additions & 0 deletions .github/workflows/markdown-fail-fast.yml
Original file line number Diff line number Diff line change
@@ -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}}
68 changes: 21 additions & 47 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
http://localhost
http://jaeger-collector
20 changes: 0 additions & 20 deletions .markdown-link.json

This file was deleted.

0 comments on commit eb003e2

Please sign in to comment.