Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ksatirli committed Jul 29, 2024
1 parent 88cd6b0 commit 3782c30
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 1 deletion.
56 changes: 56 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This is a Terraform-managed file; manual changes will be overwritten.
# see https://github.com/workloads/github-organization/blob/main/templates/workflows/markdown.tftpl.yml

---

name: "Documentation: Link Checker"

# yamllint disable-line rule:truthy
on:
push:

# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions: read-all

jobs:
workflow:
# only run if workflows are enabled
if: ${{ vars.ENABLE_WORKFLOWS == 'true' }}

# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

name: Markdown
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
# see https://github.com/actions/checkout/releases/tag/v4.1.1
- name: Checkout Repository
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # ref: `tags/v4.1.1`
with:
fetch-depth: 1

# see https://github.com/gaurav-nelson/github-action-markdown-link-check/releases/tag/1.0.15
- name: Check Links in Markdown files
uses: "gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec" # ref: `tags/1.0.15`
with:
check-modified-files-only: no
config-file: ".markdown-link-check.json"
file-extension: ".md"
use-verbose-mode: yes

workflow-inactive:
# only run if workflows are disabled
if: ${{ vars.ENABLE_WORKFLOWS != 'true' }}

name: Workflow Status
runs-on: ubuntu-latest
timeout-minutes: 1

steps:
- name: Display Workflow Status
# shellcheck disable=SC2006
run: echo "::notice title='Workflow is not currently active'::'Check if `ENABLE_WORKFLOWS` is set to `true`.'"
4 changes: 4 additions & 0 deletions .markdown-link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"timeout": "30s",
"retryOn429": true
}
20 changes: 20 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions templates/.markdown-link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"timeout": "30s",
"retryOn429": true
}
56 changes: 56 additions & 0 deletions templates/workflows/markdown.tftpl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This is a Terraform-managed file; manual changes will be overwritten.
# see https://github.com/workloads/github-organization/blob/main/templates/workflows/markdown.tftpl.yml

---

name: "Documentation: Link Checker"

# yamllint disable-line rule:truthy
on:
push:

# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions: read-all

jobs:
workflow:
# only run if workflows are enabled
if: $${{ vars.ENABLE_WORKFLOWS == 'true' }}

# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: "$${{ github.workflow }}-$${{ github.ref }}"
cancel-in-progress: true

name: Markdown
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
# see https://github.com/${checkout.owner}/${checkout.repository}/releases/tag/${checkout.version}
- name: Checkout Repository
uses: "${checkout.owner}/${checkout.repository}@${checkout.sha}" # ref: `${checkout.ref}`
with:
fetch-depth: 1

# see https://github.com/${markdown.owner}/${markdown.repository}/releases/tag/${markdown.version}
- name: Check Links in Markdown files
uses: "${markdown.owner}/${markdown.repository}@${markdown.sha}" # ref: `${markdown.ref}`
with:
check-modified-files-only: no
config-file: ".markdown-link-check.json"
file-extension: ".md"
use-verbose-mode: yes

workflow-inactive:
# only run if workflows are disabled
if: $${{ vars.ENABLE_WORKFLOWS != 'true' }}

name: Workflow Status
runs-on: ubuntu-latest
timeout-minutes: 1

steps:
- name: Display Workflow Status
# shellcheck disable=SC2006
run: echo "::notice title='Workflow is not currently active'::'Check if `ENABLE_WORKFLOWS` is set to `true`.'"
2 changes: 1 addition & 1 deletion terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {

# see https://developer.hashicorp.com/terraform/cli/cloud/settings#workspaces
workspaces {
name = "repositories"
name = "github-organization"
}
}

Expand Down

0 comments on commit 3782c30

Please sign in to comment.