-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 998 Bytes
/
lint.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
---
name: Lint
'on':
push:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set DEFAULT_BRANCH to PR target
if: ${{ github.base_ref != '' }}
run: |
# shellcheck disable=2086
echo "DEFAULT_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
echo "this is a PR branch. only lint files that are changed"
- name: Set DEFAULT_BRANCH to current branch
if: ${{ github.base_ref == '' }}
run: |
# shellcheck disable=2086
echo "DEFAULT_BRANCH=$(echo '${{ github.ref }}' |
sed 's/refs\/heads\///')" >> $GITHUB_ENV
echo "this is just a branch push, not a PR."
- name: Lint Code Base
uses: github/super-linter/slim@v6
env:
DEFAULT_BRANCH: ${{ env.DEFAULT_BRANCH }}
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.TOKEN }}