From 1d613e9cb3ca906ede82f8b9b1c54bf02dbce75a Mon Sep 17 00:00:00 2001 From: Melissa Klein <43244625+melissaklein24@users.noreply.github.com> Date: Thu, 5 Nov 2020 14:40:10 -0500 Subject: [PATCH] ci: Add Open Source Policy Workflow --- .github/workflows/repolinter.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/repolinter.yml diff --git a/.github/workflows/repolinter.yml b/.github/workflows/repolinter.yml new file mode 100644 index 0000000..acb921f --- /dev/null +++ b/.github/workflows/repolinter.yml @@ -0,0 +1,31 @@ +# NOTE: This file should always be named `repolinter.yml` to allow +# workflow_dispatch to work properly +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/community-plus.yml + output_type: issue