Skip to content

Commit

Permalink
Merge pull request #360 from harmeetsingh11/feature/codeql-and-pr-tit…
Browse files Browse the repository at this point in the history
…le-checker-workflow/issue-359

feat: add codeql and pr title checker workflow
  • Loading branch information
Kritika30032002 committed Feb 5, 2024
2 parents d54227a + 6dd4237 commit d7f1ffa
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/pr-title-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"LABEL": {
"name": "title needs formatting",
"color": "F9D0C4"
},
"CHECKS": {
"prefixes": [
"build: ",
"chore: ",
"docs: ",
"feat: ",
"fix: ",
"perf: ",
"refactor: ",
"revert: ",
"style: ",
"test: "
]
},
"MESSAGES": {
"success": "Everything is great. Status: 200",
"failure": "PR title does not confirm to the required format. Please use one of the specified prefixes followed by a colon and a space. Status: 400",
"notice": ""
}
}
42 changes: 42 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'CodeQL'

on:
push:
branches: ['main']
pull_request:
branches: ['main']
schedule:
- cron: '19 19 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript-typescript']

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{matrix.language}}'
19 changes: 19 additions & 0 deletions .github/workflows/pr-title-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'PR Title Checker'
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/pr-title-checker@v1.3.7
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: false
configuration_path: '.github/pr-title-checker.json'

0 comments on commit d7f1ffa

Please sign in to comment.