-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (42 loc) · 1.34 KB
/
check-lint-auto-approve.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Check for differences from the previous lint rule
on:
workflow_dispatch:
pull_request:
branches:
- "main"
jobs:
auto-approve:
if: contains(github.head_ref, ${{ vars.AUTO_UPDATE_BRANCH_NAME }})
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
contents: write
pull-requests: write
env:
DIFF_FILE: diff.txt
PROGRAM_DIR: tools/check_lint_rules_identity
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: branch
- name: Set up dart
uses: dart-lang/setup-dart@v1
with:
sdk: "3.1.0" # See: tools/check_lint_rules_identity/pubspec.yaml
- name: Install dependencies
run: dart pub get
shell: bash
working-directory: ${{ env.PROGRAM_DIR }}
- name: Create diff.txt
run: git diff --name-only origin/main > ${{ env.DIFF_FILE }}
- name: Run check_lint_rules_identity
run: dart run ${{ env.PROGRAM_DIR }}/bin/check_lint_rules_identity.dart ${{ env.DIFF_FILE }} lib
shell: bash
id: identiry
continue-on-error: true
- name: Auto approve
uses: hmarr/auto-approve-action@v3
if: steps.identiry.outcome == 'success'
with:
review-message: Approved. Because it is the same lint rule as the previous version.