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

Feat/linter #4

Closed
wants to merge 10 commits into from
Closed
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
37 changes: 37 additions & 0 deletions .github/workflows/audi-test-pr.ym;
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Github PR Audit

on:
pull_request:
types:
- opened
- edited
- labeled
- unlabeled

issue_comment:
types:
- created
- edited
- deleted

jobs:
Audit-Pull-Request:
runs-on: ubuntu-latest

steps:
- uses: actions/github-script@v6
with:
script: |
const requiredLabels = ['no release notes', 'public release notes'];
let labels = [];

if (context.payload.pull_request) {
labels = context.payload.pull_request.labels;
} else if (context.payload.issue) {
labels = context.payload.issue.labels;
}

if (labels.filter(l => requiredLabels.includes(l.name)).length === 0) {
throw new Error(`Required labels: ${requiredLabels.join(', ')}`);
}

33 changes: 33 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
### Super Linter
name: Linting Code Base using Super Linter
on:
push:
# branches: [main]
pull_request:
# branches: [main]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
# Checkout whole repo for Lint
fetch-depth: 0
- name: Lint Whole Repository
# Slim do not have rust, pwsh, c#, armttk , dotenv, rust linters and its bit fast
uses: super-linter/super-linter/slim@v5.7.2
env:
# ALL_codebase parse the entire repository and find all files to validate across all types. NOTE: When set to false, only new or edited files will be parsed for validation.
# DEFAULT_BRANCH: [ "main", "Feat/Linter", "Test/Linter", "Normturtle-details", "Third-Branch" ]
VALIDATE_ALL_CODEBASE: true
VALIDATE_MARKDOWN: false
VALIDATE_NATURAL_LANGUAGE: false # disable linting Text/Markdown
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

30 changes: 0 additions & 30 deletions .github/workflows/super-linter.yml

This file was deleted.