Skip to content

Commit

Permalink
#69 add linter workflow and update permissions (#84)
Browse files Browse the repository at this point in the history
* linter test

* #69 cleanup

* #69 fix linting

* #69 fix linting
  • Loading branch information
kernelsam authored Jan 10, 2024
1 parent 75a3d1e commit 9aad447
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/add-labels-to-issue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
SENZING_MEMBERS:
required: false

permissions:
issues: write

jobs:

add-customer-submission-label:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: 'issue automation'
on:
issues:
types:
- reopened
- opened
- reopened

jobs:

Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/lint-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 'lint workflows'

on:
workflow_call:
inputs:
validate-all-codebase:
default: false
description: 'Lint all files or only modified: true/false.'
required: false
type: boolean

permissions:
contents: read
packages: read
statuses: write

jobs:
# In order to require linting as a status check we need to
# run the overall workflow on every pr.
# This is used to skip at the job level if there are no
# changes to the workflow files.
changes:
runs-on: ubuntu-latest
outputs:
workflows: ${{ steps.changes.outputs.workflows }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
workflows:
- '.github/workflows/**'
lint-workflows:
name: Lint Workflows
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.workflows == 'true' }}

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter@v5
env:
DEFAULT_BRANCH: main
FILTER_REGEX_INCLUDE: .*.github/workflows/.*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# only lint new and modified files
VALIDATE_ALL_CODEBASE: false

0 comments on commit 9aad447

Please sign in to comment.