-
Notifications
You must be signed in to change notification settings - Fork 551
50 lines (46 loc) · 1.42 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Lint
on:
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm i
- run: npm run lint:formatting
- run: npm run lint:check-links
check_quickstarts:
runs-on: ubuntu-latest
outputs:
output: ${{ steps.check.outputs.output }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
git fetch origin ${{ github.base_ref }}
git checkout ${{ github.base_ref }}
git checkout ${{ github.sha }}
- run: npm i
- id: check
run: |
OUTPUT=$(npm run lint:check-quickstarts | tail -n +4)
# We need this specific syntax because the output has multiple lines
echo "output<<EOF" >> $GITHUB_OUTPUT
echo "$OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
share_quickstart_changes:
needs: check_quickstarts
if: contains(needs.check_quickstarts.outputs.output, 'Please update the corresponding quickstarts in the Dashboard')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${{ needs.check_quickstarts.outputs.output }}`
})