Skip to content

Commit

Permalink
feature: Add GitHub workflows for automatic PR labeling, CLA assistan…
Browse files Browse the repository at this point in the history
…t, and code linting
  • Loading branch information
borislavr committed Jan 23, 2025
1 parent dc8853d commit 9f18f1d
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/auto-labeler-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

conventional-commits:
- type: 'fix'
nouns: ['FIX', 'Fix', 'fix', 'FIXED', 'Fixed', 'fixed']
labels: ['fix']
- type: 'feature'
nouns: ['FEATURE', 'Feature', 'feature', 'FEAT', 'Feat', 'feat']
labels: ['feature']
- type: 'breaking_change'
nouns: ['BREAKING CHANGE', 'BREAKING', 'MAJOR']
labels: ['breaking-change']
- type: 'bug'
nouns: ['bug', 'Bug', 'BUG']
labels: ['bug']
- type: 'bugfix'
nouns: ['bugfix', 'Bugfix', 'bug-fix', 'BugFix']
labels: ['bugfix']
42 changes: 42 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'


categories:
- title: '💥 Breaking Changes'
labels:
- breaking-change
- title: '🚀 New Features'
labels:
- feature
- title: '🐛 Bug Fixes'
labels:
- bug
- fix
- bugfix
- title: '🛠️ Technical Debt'
labels:
- refactor

change-template: '- $TITLE (#$NUMBER) by @$AUTHOR'
no-changes-template: 'No significant changes'

template: |
## 🚀 Release
### What's Changed
$CHANGES
**Contributors:** $CONTRIBUTORS
version-resolver:
major:
labels:
- major
minor:
labels:
- minor
patch:
labels:
- patch
default: patch
18 changes: 18 additions & 0 deletions .github/workflows/automatic-pr-labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

name: Automatic PR Labeler

on:
pull_request:
branches: [main]
types:
[opened, reopened]

jobs:
assign-labels:
uses: Netcracker/qubership-workflow-hub/.github/workflows/auto-labeler.yaml@main
name: Assign labels in pull request
if: github.event.pull_request.merged == false
with:
pull_request_number: ${{ github.event.pull_request.number }}
config_file: './.github/auto-labeler-config.yaml'
12 changes: 12 additions & 0 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: CLA Assistant
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened,closed,synchronize]
jobs:
cla_assistant:
uses: Netcracker/qubership-workflow-hub/.github/workflows/cla.yaml@main
secrets:
personal_access_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
10 changes: 10 additions & 0 deletions .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Prettier-fix
on: [pull_request, workflow_dispatch]

permissions:
contents: write

jobs:
call-prettier-fix:
uses: Netcracker/qubership-workflow-hub/.github/workflows/prettierFix.yaml@main
18 changes: 18 additions & 0 deletions .github/workflows/profanity-filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Profanity filter

on:
issue_comment:
types: [created, edited]
issues:
types: [opened, edited, reopened]
pull_request:
types: [opened, edited, reopened]

permissions:
issues: write
pull-requests: write

jobs:
call-apply-filter:
uses: Netcracker/qubership-workflow-hub/.github/workflows/profanityFilter.yaml@main
36 changes: 36 additions & 0 deletions .github/workflows/super-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow executes several linters on changed files based on languages used in your code base whenever
# you push a code or open a pull request.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/github/super-linter
name: Lint Code Base

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
full_scan:
type: boolean
default: false
required: false
description: "Lint all codebase"
jobs:
run-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: ${{ inputs.full_scan || false }}
DEFAULT_BRANCH: "main"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 9f18f1d

Please sign in to comment.