Skip to content

feat: add AWS Config compliance-results-to-OSCAL-AR task #5462

feat: add AWS Config compliance-results-to-OSCAL-AR task

feat: add AWS Config compliance-results-to-OSCAL-AR task #5462

Workflow file for this run

name: "Lint PR title"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
branches:
- 'main'
- 'develop'
- 'v[0-9]*'
permissions:
contents: read
jobs:
lint:
if: ${{ github.head_ref != 'develop' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: npm install @commitlint/cli @commitlint/config-conventional
- name: Validate PR title
run: |
PR_TITLE=$(jq -r '.pull_request.title' "$GITHUB_EVENT_PATH")
echo "$PR_TITLE" | npx commitlint --config commitlint.config.js
- name: Validate commit type for maintenance branch
if: startsWith(github.base_ref, 'v')
run: |
PR_TITLE=$(jq -r '.pull_request.title' "$GITHUB_EVENT_PATH" | sed 's/^[[:space:]]*//')
ALLOWED_TYPES='^(fix|perf|chore|ci|docs|build|refactor|style|test|revert)(\(.*\))?:'
if ! echo "$PR_TITLE" | grep -qiE "$ALLOWED_TYPES"; then
echo "::error::PR title must use an allowed type for maintenance branches: fix, perf, chore, ci, docs, build, refactor, style, test, revert."
echo "::error::Got: $PR_TITLE"
exit 1
fi