Skip to content

Commit 6241a27

Browse files
authoredDec 14, 2020
Merge pull request #41 from newrelic/feature/repolinter-action
ci: Add Open Source Policy Workflow
2 parents 664e32f + 4a85df8 commit 6241a27

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
 

‎.github/workflows/repolinter.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# NOTE: This file should always be named `repolinter.yml` to allow
2+
# workflow_dispatch to work properly
3+
name: Repolinter Action
4+
5+
# NOTE: This workflow will ONLY check the default branch!
6+
# Currently there is no elegant way to specify the default
7+
# branch in the event filtering, so branches are instead
8+
# filtered in the "Test Default Branch" step.
9+
on: [push, workflow_dispatch]
10+
11+
jobs:
12+
repolint:
13+
name: Run Repolinter
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Test Default Branch
17+
id: default-branch
18+
uses: actions/github-script@v2
19+
with:
20+
script: |
21+
const data = await github.repos.get(context.repo)
22+
return data.data && data.data.default_branch === context.ref.split('/').slice(-1)[0]
23+
- name: Checkout Self
24+
if: ${{ steps.default-branch.outputs.result == 'true' }}
25+
uses: actions/checkout@v2
26+
- name: Run Repolinter
27+
if: ${{ steps.default-branch.outputs.result == 'true' }}
28+
uses: newrelic/repolinter-action@v1
29+
with:
30+
config_url: https://raw.githubusercontent.com/newrelic/.github/main/repolinter-rulesets/community-plus.yml
31+
output_type: issue

0 commit comments

Comments
 (0)
Please sign in to comment.