Skip to content

Commit

Permalink
Pin GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jtduffy committed May 20, 2024
1 parent 0f92f45 commit bcc98a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/repolinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Repolinter Action
# 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]
on: [ push, workflow_dispatch ]

jobs:
repolint:
Expand All @@ -15,17 +15,17 @@ jobs:
steps:
- name: Test Default Branch
id: default-branch
uses: actions/github-script@v7
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7
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@v4
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # pin@v4
- name: Run Repolinter
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: newrelic/repolinter-action@v1
uses: newrelic/repolinter-action@3f4448f855c351e9695b24524a4111c7847b84cb # pin@v1
with:
config_url: https://raw.githubusercontent.com/newrelic/.github/main/repolinter-rulesets/community-project.yml
output_type: issue

0 comments on commit bcc98a8

Please sign in to comment.