-
Notifications
You must be signed in to change notification settings - Fork 86
174 lines (161 loc) · 5.22 KB
/
reviewdog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
name: ReviewDog
# yamllint disable-line rule:truthy
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
jobs:
markdownlint:
name: runner / markdownlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: markdownlint
uses: reviewdog/action-markdownlint@v0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check
misspell:
name: runner / misspell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-misspell@v1
with:
github_token: ${{ secrets.github_token }}
locale: US
reporter: github-check
level: warning
exclude: |
./.git/*
./.cache/*
./examples/**/output.yaml
pattern: |
*.md
*.yaml
*.yml
*.alloy
*.txt
*.tmpl
*.gotmpl
languagetool:
name: runner / languagetool
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-languagetool@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
level: info
patterns: |
./*.md
./**/*.md
./**/**/*.md
./**/**/**/*.md
!./node-modules/**
alex:
name: runner / alex
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-alex@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
# GitHub Status Check won't become failure with warning.
level: warning
shellcheck:
name: runner / shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
exclude: |
./.git/*
./.cache/*
./tests/spec/*
pattern: |
*.sh
*.bash
tflint:
name: runner / tflint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-tflint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
yamllint:
name: runner / yamllint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-yamllint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
actionlint:
name: runner / actionlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-actionlint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
textlint:
name: runner / textlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-setup@v1
- run: npm install
- env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx textlint --format checkstyle --config ./.textlintrc --ignore-path ./.textlintignore "$(find . -type f -name "*.md" -not \( -path "./node_modules/*" -o -path "./data-alloy/*" \))" | \
reviewdog -f=checkstyle -name="textlint" -reporter=github-check -level=info
alloy:
name: runner / alloy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-setup@v1
- run: |
GITHUB_ORG="grafana" && \
GITHUB_REPO="alloy" && \
ARCHIVE="alloy" && \
BINARY="alloy" && \
BIN_PATH="/usr/local/bin" && \
TMP_PATH="/tmp" && \
ALLOY_VERSION=$(wget -q -O - "https://api.github.com/repos/$GITHUB_ORG/$GITHUB_REPO/releases/latest" \
| grep -m 1 tag_name \
| cut -d '"' -f 4 | cut -c2-) && \
HOST_OS=$(uname -a | awk '{print tolower($1)}') && \
HOST_ARCH=$(arch | sed 's/x86_64/amd64/') && \
DOWNLOAD_URL="https://github.com/$GITHUB_ORG/$GITHUB_REPO/releases/download" && \
DOWNLOAD_URL="$DOWNLOAD_URL/v$ALLOY_VERSION/$ARCHIVE-$HOST_OS-$HOST_ARCH.zip"
echo "Downloading $DOWNLOAD_URL to $TMP_PATH/$ARCHIVE.zip" && \
wget -q -O "$TMP_PATH/$ARCHIVE.zip" "$DOWNLOAD_URL" && \
echo "Unzipping: $TMP_PATH/$ARCHIVE.zip" && \
( cd "$TMP_PATH" || exit ; unzip -qq -o -d "$TMP_PATH" "$TMP_PATH/$BINARY.zip" ) && \
rm -rf "$TMP_PATH/$ARCHIVE.zip" && \
chmod a+x "$TMP_PATH/$BINARY-$HOST_OS-$HOST_ARCH" &&
echo "Moving: $TMP_PATH/$ARCHIVE-$HOST_OS-$HOST_ARCH/$BINARY to $BIN_PATH/$BINARY" && \
sudo mv "$TMP_PATH/$BINARY-$HOST_OS-$HOST_ARCH" "$BIN_PATH/$BINARY" && \
rm -rf "$TMP_PATH/$ARCHIVE-$HOST_OS-$HOST_ARCH"
echo ""
# shellcheck disable=SC2034
alloy --version
- env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/lint-alloy.sh --format=checkstyle | \
reviewdog -f=checkstyle -name="alloy" -reporter=github-pr-check