diff --git a/.github/workflows/repolinter.yml b/.github/workflows/repolinter.yml new file mode 100644 index 0000000..e04d415 --- /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_file: test_policy.yaml + output_type: issue diff --git a/README.md b/README.md deleted file mode 100644 index cc17752..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# My Open Source Project - -Hello world! This repository (and its organization) is designed to showcase [repolinter](https://github.com/todogroup/repolinter). The code in this project is based on Microsoft's [TypeScript React Starter](https://github.com/microsoft/TypeScript-React-Starter), and is licensed under MIT unless otherwise indicated. \ No newline at end of file diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..6237b6d --- /dev/null +++ b/README.rst @@ -0,0 +1,17 @@ +********************** +My Open Source Project +********************** + +Hello world! This repository (and its organization) is designed to showcase `repolinter `_. The code in this project is based on Microsoft's `TypeScript React Starter `_, and is licensed under MIT unless otherwise indicated. + +Useful Links +============ + + * `Code of Conduct <./CODE_OF_CONDUCT.md>`_ + * `License <./LICENCE>`_ + * `Typo URL `_ + * `New Relic Discuss Topic `_ + * `Security Policy <../../security/policy>`_ + * `Private Source Link `_ + * Relative Section Link: `Useful Links`_ + diff --git a/test_policy.yaml b/test_policy.yaml new file mode 100644 index 0000000..0f380f7 --- /dev/null +++ b/test_policy.yaml @@ -0,0 +1,94 @@ +# Schema: https://raw.githubusercontent.com/newrelic-forks/repolinter/master/rulesets/schema.json +version: 2 +axioms: {} +rules: + readme-no-broken-links: + level: error + rule: + type: file-no-broken-links + options: + globsAll: + - README* + nocase: true + pass-external-relative-links: true + readme-file-exists: + level: error + rule: + type: file-existence + options: + globsAny: + - README* + nocase: true + fix: + type: file-create + options: + file: README.md + text: + url: https://raw.githubusercontent.com/newrelic/open-source-tools/master/nerdpacks/oss-template/README.md + policyInfo: >- + New Relic requires a README file in all projects. This README should + give a general overview of the project, and should point to additional resources + (security, contributing, etc.) where developers and users can learn further + policyUrl: https://github.com/newrelic/open-by-default + readme-contains-discuss-topic: + level: error + rule: + type: file-contents + options: + globsAll: + - README* + fail-on-non-exist: true + flags: i + content: discuss\.newrelic\.com + human-readable-content: a link to the appropriate discuss.newrelic.com topic + policyInfo: >- + New Relic recommends directly linking the your appropriate discuss.newrelic.com + topic in the README, allowing developer an alternate method of getting support + policyUrl: https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code + code-of-conduct-file-does-not-exist: + level: error + rule: + type: file-not-exists + options: + globsAll: + - CODE_OF_CONDUCT* + - CODE-OF-CONDUCT* + - CODEOFCODUCT + nocase: true + fix: + type: file-remove + options: {} + policyInfo: >- + New Relic has moved the `CODE_OF_CONDUCT` file to a [centralized location](https://github.com/newrelic/.github/blob/main/CODE_OF_CONDUCT.md) + where it is referenced automatically by every repository in the New Relic organization. Because of this change, any other `CODE_OF_CONDUCT` file + in a repository is now redundant and should be removed + policyUrl: https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view + third-party-notices-file-exists: + level: warning + rule: + type: file-existence + options: + globsAny: + - THIRD_PARTY_NOTICES* + - THIRD-PARTY-NOTICES* + - THIRDPARTYNOTICES* + nocase: true + policyInfo: >- + A [`THIRD_PARTY_NOTICES.md`](https://github.com/newrelic/opensource-website/blob/develop/THIRD_PARTY_NOTICES.md) + file can be present in your repository to grant attribution to all dependencies + being used by this project. This document is necessary if you are using + third-party source code in your project, with the exception of code referenced outside + the project's compiled/bundled binary (ex. some Java projects require modules to + be pre-installed in the classpath, outside the project binary and therefore + outside the scope of the `THIRD_PARTY_NOTICES`). Please + review your project's dependencies and create a THIRD_PARTY_NOTICES.md file if + necessary. For JavaScript projects, you can generate this file using the + [oss-cli](https://github.com/newrelic/newrelic-oss-cli) + policyUrl: https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view +formatOptions: + disclaimer: >- + 🤖*This issue was automatically generated by [repolinter-action](https://github.com/newrelic/repolinter-action), + developed by the Open Source and Developer Advocacy team at New Relic. This issue + will be automatically updated or closed when changes are pushed. If you have any + problems with this tool, please feel free to open a GitHub issue or give us a + ping in #help-opensource.* \ No newline at end of file