This repository has been archived by the owner on Nov 20, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
71 lines (54 loc) · 1.66 KB
/
pull-request.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: auto-format
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
on:
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
- unlocked
jobs:
perform-checks:
if: |
github.repository == github.event.pull_request.head.repo.full_name
&& github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: ok-nick/[email protected]
with:
cache: true
- name: Lint
run: selene src
- name: Ensure version parity
run: lune run ensure-version-parity
- name: Fetch version from package.json
id: current-version
run: echo "current-version=$(jq -r .version package.json)" >> $GITHUB_ENV
- name: Get previous release version
id: previous-version
run: echo "previous-version=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Ensure version has changed
run: ${{ steps.current-version.outputs.current-version != steps.previous-version.outputs.previous-version }}
- name: Ensure tests exist
run: lune run ensure-tests src
format:
needs: perform-checks
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ok-nick/[email protected]
with:
cache: true
- name: Format files
run: lune run format-files src
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Auto-format files"