diff --git a/.github/workflows/convention.yml b/.github/workflows/convention.yml index c4aeb7c1b1..0694b9eaff 100644 --- a/.github/workflows/convention.yml +++ b/.github/workflows/convention.yml @@ -1,19 +1,30 @@ -name: PR Naming Convention Check +name: PR Title Validation on: - pull_request: - types: [opened, edited, reopened, synchronize] + # pull_request_target is ok until we do not checkout and build external code + # TODO: maybe it is not required after all https://github.com/amannn/action-semantic-pull-request/issues/219 + pull_request_target: + types: [opened, reopened, synchronize, edited] + +permissions: + pull-requests: read jobs: - check-name: + title-check: + name: Check PR Title runs-on: ubuntu-latest - if: contains(github.event.pull_request.labels.*.name, '🙋 Bounty claim') + steps: - - name: Check PR Title - id: check_title - run: | - PR_TITLE="${{ github.event.pull_request.title }}" - if [[ ! "$PR_TITLE" =~ ^\[ISSUE_[0-9]+\]\ .+ ]]; then - echo "PR title does not follow the naming convention [ISSUE_NUMBER] " - exit 1 - fi + - name: PR Title + uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Bounty PR Title + if: contains(github.event.pull_request.labels.*.name, '🙋 Bounty claim') + uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + requireScope: true + scopes: \d+