Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#69 add linter workflow and update permissions #84

Merged
merged 4 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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