forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (36 loc) · 1.3 KB
/
ci_build_target_list.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
name: Determine list of PR targets
on:
pull_request:
types: [opened, synchronize]
permissions:
contents: read
jobs:
test_pr_trigger:
name: Determine list of PR targets
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli
steps:
- name: Prerequisites
run: |
apt update
apt install -y jq curl
- name: Checkout base
uses: actions/checkout@v4
with:
path: base_repo
ref: ${{ github.event.pull_request.base.sha }}
- name: Checkout target
uses: actions/checkout@v4
with:
path: target_repo
ref: ${{ github.event.pull_request.merge_commit_sha }}
- name: List changed files
run: |
# Get the base commit so we can do a diff against it
git -C target_repo fetch origin ${{ github.event.pull_request.base.sha }}
echo "Different files:"
git -C target_repo diff --name-only ${{ github.event.pull_request.base.sha }}
- name: List added targets
run: |
pwd
python3 ./target_repo/util/ci/pull_request_targets.py "--base-path=$(realpath base_repo)" "--target-path=$(realpath target_repo)" "--merge-sha=${{ github.event.pull_request.merge_commit_sha }}" "--base-sha=${{ github.event.pull_request.base.sha }}"