diff --git a/.github/actions/pr-title-checker b/.github/actions/pr-title-checker new file mode 160000 index 000000000..1d8cd483a --- /dev/null +++ b/.github/actions/pr-title-checker @@ -0,0 +1 @@ +Subproject commit 1d8cd483a2b73118406a187f54dca8a9415f1375 diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json new file mode 100644 index 000000000..4d3d2e48f --- /dev/null +++ b/.github/pr-title-checker-config.json @@ -0,0 +1,14 @@ +{ + "LABEL": { + "name": "title needs formatting", + "color": "EEEEEE" + }, + "CHECKS": { + "regexp": "^BIGTOP-\\d{1,9}: .*" + }, + "MESSAGES": { + "success": "PR title is valid", + "failure": "PR title is invalid", + "notice": "PR Title needs to pass regex '^BIGTOP-\\d{1,9}: .*'" + } +} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6822ade7d..01c878a30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,4 @@ +name: CI on: [push, pull_request] jobs: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 000000000..7f03f4d91 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,21 @@ +name: "Pull Request" +on: + pull_request: + types: [opened, edited, reopened, synchronize] + +jobs: + check-pr-title: + name: "Check PR Title" + runs-on: ubuntu-latest + steps: + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@v4 + with: + persist-credentials: false + submodules: recursive + - name: "Check PR Title" + uses: ./.github/actions/pr-title-checker + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pass_on_octokit_error: false + configuration_path: .github/pr-title-checker-config.json diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..66d503fbb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".github/actions/pr-title-checker"] + path = .github/actions/pr-title-checker + url = https://github.com/thehanimo/pr-title-checker.git diff --git a/.licenserc.yaml b/.licenserc.yaml index f436ea475..d2ad311f4 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -21,6 +21,8 @@ header: copyright-owner: Apache Software Foundation paths-ignore: + - '.gitmodules' + - '.github/actions' - '**/.idea/' - '**/*.iml' - '**/target/**'