Skip to content

Commit

Permalink
Merge pull request #44 from newrelic/feature/repolinter-action
Browse files Browse the repository at this point in the history
ci: Add Open Source Policy Workflow
  • Loading branch information
tangollama authored Sep 2, 2020
2 parents 20f8cfc + d70f58c commit 3dc6e25
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/repolinter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Repolinter Action

# NOTE: This workflow will ONLY check the default branch!
# Currently there is no elegant way to specify the default
# branch in the event filtering, so branches are instead
# filtered in the "Test Default Branch" step.
on: [push, workflow_dispatch]

jobs:
repolint:
name: Run Repolinter
runs-on: ubuntu-latest
steps:
- name: Test Default Branch
id: default-branch
uses: actions/github-script@v2
with:
script: |
const data = await github.repos.get(context.repo)
return data.data && data.data.default_branch === context.ref.split('/').slice(-1)[0]
- name: Checkout Self
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: actions/checkout@v2
- name: Run Repolinter
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: newrelic/repolinter-action@v1
with:
config_url: https://github.com/raw/newrelic/.github/main/repolinter-rulesets/new-relic-one-catalog-project.json
output_type: issue

0 comments on commit 3dc6e25

Please sign in to comment.