-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 1.22 KB
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Pull Request
on:
pull_request:
branches: [main]
types: [opened, edited, reopened, synchronize]
env:
CONVCO_VERSION: v0.6.1
jobs:
pr-convco-title-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install convco
run: |
curl -sSfL "https://github.com/convco/convco/releases/download/${{ env.CONVCO_VERSION }}/convco-ubuntu.zip" | zcat > /usr/local/bin/convco
chmod +x /usr/local/bin/convco
- name: Check PR Title is Conventional
run: echo "${{ github.event.pull_request.title }}" | convco check --from-stdin
dismiss-stale-pr-reviews:
runs-on: ubuntu-22.04
if: github.event.action == 'edited'
steps:
- name: Auth. Github-CLI
run: echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
shell: bash
- name: Dismiss approvals
run: |
gh api "repos/${{ github.repository }}/pulls/${{ github.event.number }}/reviews" \
--jq '.[] | select(.state == "APPROVED") | .id' \
| xargs -I '{}' gh api --method=PUT -f message="Dismissed due to PR edit." \
"repos/${{ github.repository }}/pulls/${{ github.event.number }}/reviews/{}/dismissals"
shell: bash