forked from lowRISC/ibex
-
Notifications
You must be signed in to change notification settings - Fork 25
49 lines (46 loc) · 1.69 KB
/
pr_lint_review.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
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
name: pr-lint-review
on:
workflow_run:
workflows: ["pr-trigger"]
types:
- completed
jobs:
review_triggered:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# this workflow does not run in a PR context
# download 'event.json' file from a PR-tiggered workflow
# to mock the PR context and make a review
- name: 'Download artifact'
id: get-artifacts
uses: actions/[email protected]
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "event.json"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/event.json.zip', Buffer.from(download.data));
- run: |
unzip event.json.zip
- name: Run Verible linter action
uses: chipsalliance/verible-linter-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
suggest_fixes: 'false'
config_file: 'vendor/lowrisc_ip/lint/tools/veriblelint/rules.vbl'