diff --git a/.github/workflows/add-pull-request-to-project.yml b/.github/workflows/add-pull-request-to-project.yml index 5762a5b..a56c6cb 100644 --- a/.github/workflows/add-pull-request-to-project.yml +++ b/.github/workflows/add-pull-request-to-project.yml @@ -1,7 +1,7 @@ name: Add Pull Request To Project on: - pull_request: - types: [opened, reopened, labeled] + pull_request_target: + types: [opened, reopened] workflow_call: secrets: ADD_TO_PROJECT_PAT: diff --git a/.github/workflows/conventional-label.yaml b/.github/workflows/conventional-label.yaml index a27b9c0..a371ade 100644 --- a/.github/workflows/conventional-label.yaml +++ b/.github/workflows/conventional-label.yaml @@ -1,26 +1,26 @@ name: 🏷 Label PR + +on: + pull_request_target: + types: + - opened + - reopened + - edited + - synchronize + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true -on: - pull_request: - types: [opened, reopened] - permissions: contents: read pull-requests: write jobs: label: - if: github.event.pull_request.labels.length == 0 + if: github.event.pull_request.labels[0] == null runs-on: ubuntu-latest steps: - - name: "Confirm correct pull request title" - uses: mmubeen/action-pr-title@master # until PR gets merged https://github.com/deepakputhraya/action-pr-title/pull/29 - with: - allowed_prefixes: 'feat,fix,build,ci,refactor,test,style,translation,docs,revert' - - name: Generate token uses: tibdex/github-app-token@v2.1.0 id: generate_token diff --git a/.github/workflows/pull-request-closed.yml b/.github/workflows/pull-request-closed.yml index c2ba463..fbd849c 100644 --- a/.github/workflows/pull-request-closed.yml +++ b/.github/workflows/pull-request-closed.yml @@ -1,7 +1,7 @@ # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries name: Pull resquest closed on: - pull_request: + pull_request_target: types: - closed diff --git a/.github/workflows/pull_request_check_title.yml b/.github/workflows/pull_request_check_title.yml index 9237e93..efcf3d8 100644 --- a/.github/workflows/pull_request_check_title.yml +++ b/.github/workflows/pull_request_check_title.yml @@ -1,7 +1,7 @@ name: Validate PR title on: - pull_request: + pull_request_target: types: - opened - reopened @@ -50,12 +50,6 @@ jobs: Current summary: "{subject}" - # If the PR only contains a single commit, the action will validate that - # it matches the configured pattern. - validateSingleCommit: true - # Related to `validateSingleCommit` you can opt-in to validate that the PR - # title matches a single commit to avoid confusion. - validateSingleCommitMatchesPrTitle: true - uses: marocchino/sticky-pull-request-comment@v2.9.0 # When the previous steps fails, the workflow would stop. By adding this diff --git a/.github/workflows/validate_pull_request_labels.yml b/.github/workflows/validate_pull_request_labels.yml index 6fddbc8..12549f0 100644 --- a/.github/workflows/validate_pull_request_labels.yml +++ b/.github/workflows/validate_pull_request_labels.yml @@ -1,14 +1,18 @@ name: "Pull Request Labels Validation" on: - pull_request: + pull_request_target: types: - opened - synchronize - reopened - labeled - unlabeled - + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + jobs: check_pull_request_labels: name: "Check pull request labels" @@ -17,13 +21,23 @@ jobs: issues: write pull-requests: write steps: + - name: Sleep for 15 seconds + run: sleep 15s + shell: bash - uses: mheap/github-action-required-labels@v5 with: - mode: "exactly" + mode: "minimum" count: 1 labels: "pull request: breaking,pull request: bug,pull request: community,pull request: dependencies,pull request: documentation,pull request: feature-major,pull request: feature-minor,pull request: maintenance,pull request: skip-changelog,pull request: translation,dependencies" add_comment: true message: "This PR is being prevented from merging because you haven't added one of the `pull request:` labels. You'll need to add one of them before this PR can be merged." + - uses: mheap/github-action-required-labels@v5 + with: + mode: "maximum" + count: 1 + labels: "pull request: breaking,pull request: bug,pull request: dependencies,pull request: documentation,pull request: feature-major,pull request: feature-minor,pull request: maintenance,pull request: translation" + add_comment: true + message: "This PR is being prevented from merging because you have added more than one `pull request:` label. You'll need to keep only one of them before this PR can be merged." check_issue_labels: name: "Check issue labels" runs-on: ubuntu-latest @@ -31,6 +45,9 @@ jobs: issues: write pull-requests: write steps: + - name: Sleep for 15 seconds + run: sleep 15s + shell: bash - uses: mheap/github-action-required-labels@v5 with: mode: "exactly"