diff --git a/.github/workflows/check_pr_title.yml b/.github/workflows/check_pr_title.yml index 01f4f2018..da46300c3 100644 --- a/.github/workflows/check_pr_title.yml +++ b/.github/workflows/check_pr_title.yml @@ -1,7 +1,7 @@ -name: Check PR title +name: Semantic PR title check on: - pull_request: + pull_request_target: types: - opened - reopened @@ -9,42 +9,17 @@ on: - synchronize - labeled - unlabeled + pull_request: paths: - '.github/workflows/check_pr_title.yml' jobs: - lint: - runs-on: ubuntu-latest + main: + name: Semantic check + runs-on: ubuntu-slim permissions: - statuses: write + pull-requests: read steps: - - uses: aslafy-z/conventional-pr-title-action@v3 + - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - spellcheck: - runs-on: ubuntu-slim - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip check PR title') }} - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - - - - name: Install aspell - run: sudo apt-get update && sudo apt-get install aspell - - - name: Check PR title spelling - env: - PR_TITLE: ${{ github.event.pull_request.title }} - run: | - echo "$PR_TITLE" - if aspell --personal="./.github/project_dict.pws" list <<< "$PR_TITLE" | grep -q .; then - echo "Misspelled words found." - aspell --personal="./.github/project_dict.pws" list <<< "$PR_TITLE" - exit 1 - else - echo "No misspelled words found." - exit 0 - fi diff --git a/.github/workflows/spellcheck_title.yml b/.github/workflows/spellcheck_title.yml new file mode 100644 index 000000000..8a1040cc2 --- /dev/null +++ b/.github/workflows/spellcheck_title.yml @@ -0,0 +1,34 @@ +name: Spellcheck PR title +on: + pull_request: + types: [opened, reopened, edited, synchronize, labeled, unlabeled] + paths: + - '.github/workflows/spellcheck_title.yml' + +jobs: + spellcheck: + runs-on: ubuntu-slim + if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip check PR title') }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + + - name: Install aspell + run: sudo apt-get update && sudo apt-get install aspell + + - name: Check PR title spelling + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + echo "$PR_TITLE" + if aspell --personal="./.github/project_dict.pws" list <<< "$PR_TITLE" | grep -q .; then + echo "Misspelled words found." + aspell --personal="./.github/project_dict.pws" list <<< "$PR_TITLE" + exit 1 + else + echo "No misspelled words found." + exit 0 + fi