Skip to content

Commit 3d2e55f

Browse files
author
Pat
authored
workflows: add basic linting and stale checks (fluent#952)
Signed-off-by: Patrick Stephens <[email protected]> Signed-off-by: Patrick Stephens <[email protected]>
1 parent 3594265 commit 3d2e55f

File tree

6 files changed

+95
-0
lines changed

6 files changed

+95
-0
lines changed

.github/actionlint-matcher.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "actionlint",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"message": 4,
12+
"code": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "workflows: "

.github/workflows/cron-stale.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Close stale issues and PR(s)'
2+
on:
3+
schedule:
4+
- cron: '30 1 * * *'
5+
6+
jobs:
7+
stale:
8+
name: Mark stale
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
steps:
14+
- uses: actions/stale@v6
15+
with:
16+
repo-token: ${{ secrets.GITHUB_TOKEN }}
17+
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the `exempt-stale` label.'
18+
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
19+
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
20+
days-before-stale: 90
21+
days-before-close: 5
22+
days-before-pr-close: -1
23+
exempt-all-pr-assignees: true
24+
exempt-all-pr-milestones: true
25+
exempt-issue-labels: 'long-term,enhancement,exempt-stale,waiting-on-code-merge'
26+
exempt-pr-labels: 'long-term,enhancement,exempt-stale,waiting-on-code-merge'
27+
# start with the oldest
28+
ascending: true
29+
# keep an eye on this
30+
operations-per-run: 250

.github/workflows/pr-lint.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint PRs
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
6+
jobs:
7+
actionlint-pr:
8+
runs-on: ubuntu-latest
9+
name: PR - Actionlint
10+
steps:
11+
- uses: actions/checkout@v3
12+
- run: |
13+
echo "::add-matcher::.github/actionlint-matcher.json"
14+
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
15+
./actionlint -color -shellcheck=
16+
shell: bash
17+
18+
docslint-pr:
19+
runs-on: ubuntu-latest
20+
name: PR - Markdownlint
21+
steps:
22+
- name: Run markdownlint
23+
uses: actionshub/[email protected]

.mdlrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style "#{File.dirname(__FILE__)}/markdownlint.rb"

markdownlint.rb

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/ruby
2+
3+
# Enable all rules by default
4+
all
5+
6+
# Extend line length, since each sentence should be on a separate line.
7+
rule 'MD013', :line_length => 99999, :ignore_code_blocks => true
8+
9+
# Allow in-line HTML
10+
exclude_rule 'MD033'
11+
12+
# Nested lists should be indented with two spaces.
13+
rule 'MD007', :indent => 2
14+
15+
# Bash defaulting confuses this and now way to ignore code blocks
16+
exclude_rule 'MD029'

0 commit comments

Comments
 (0)