|
1 |
| -name: Pull Request |
| 1 | +name: contrib |
2 | 2 |
|
3 | 3 | on:
|
| 4 | + issue_comment: |
| 5 | + types: [created] |
4 | 6 | pull_request_target:
|
5 | 7 | types:
|
| 8 | + - opened |
| 9 | + - closed |
| 10 | + - synchronize |
6 | 11 | - labeled
|
7 | 12 | - unlabeled
|
8 | 13 | - opened
|
|
13 | 18 | concurrency: pr-${{ github.ref }}
|
14 | 19 |
|
15 | 20 | jobs:
|
16 |
| - lint-title: |
17 |
| - name: Lint title |
| 21 | + # Dependabot is annoying, but this makes it a bit less so. |
| 22 | + auto-approve: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + if: github.event_name == 'pull_request_target' |
| 25 | + permissions: |
| 26 | + pull-requests: write |
| 27 | + steps: |
| 28 | + - uses: hmarr/auto-approve-action@v3 |
| 29 | + if: github.actor == 'dependabot[bot]' |
| 30 | + |
| 31 | + cla: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - name: cla |
| 35 | + if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' |
| 36 | + uses: contributor-assistant/github-action@v2.2.1 |
| 37 | + env: |
| 38 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 39 | + # the below token should have repo scope and must be manually added by you in the repository's secret |
| 40 | + PERSONAL_ACCESS_TOKEN: ${{ secrets.CDRCOMMUNITY_GITHUB_TOKEN }} |
| 41 | + with: |
| 42 | + remote-organization-name: "coder" |
| 43 | + remote-repository-name: "cla" |
| 44 | + path-to-signatures: "v2022-09-04/signatures.json" |
| 45 | + path-to-document: "https://github.com/coder/cla/blob/main/README.md" |
| 46 | + # branch should not be protected |
| 47 | + branch: "main" |
| 48 | + allowlist: dependabot* |
| 49 | + |
| 50 | + title: |
18 | 51 | runs-on: ubuntu-latest
|
| 52 | + if: github.event_name == 'pull_request_target' |
19 | 53 | steps:
|
20 |
| - - uses: amannn/action-semantic-pull-request@v5 |
| 54 | + - name: Validate PR title |
| 55 | + uses: amannn/action-semantic-pull-request@v5 |
21 | 56 | env:
|
22 | 57 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
23 | 58 | with:
|
|
29 | 64 | # Depend on lint so that title is Conventional Commits-compatible.
|
30 | 65 | needs: [lint-title]
|
31 | 66 | # Skip tagging for draft PRs.
|
32 |
| - if: ${{ success() && !github.event.pull_request.draft }} |
| 67 | + if: ${{ github.event_name == 'pull_request_target' && success() && !github.event.pull_request.draft }} |
33 | 68 | steps:
|
34 | 69 | - uses: actions/github-script@v6
|
35 | 70 | with:
|
|
0 commit comments