forked from Julien4218/ansible-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from newrelic/pns/repo-setup-changes
chore: Add Repolinter workflow action
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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@v6 | ||
with: | ||
script: | | ||
const data = await github.rest.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@v3 | ||
- name: Run Repolinter | ||
if: ${{ steps.default-branch.outputs.result == 'true' }} | ||
uses: newrelic/repolinter-action@v1 | ||
with: | ||
config_url: https://raw.githubusercontent.com/newrelic/.github/main/repolinter-rulesets/community-project.yml | ||
output_type: issue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters