-
Notifications
You must be signed in to change notification settings - Fork 331
56 lines (47 loc) · 1.58 KB
/
detect_sha_changes.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
name: Detect changes to header SHAs
on:
pull_request:
jobs:
build:
name: Add annotations
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: "Checkout mathlib4"
uses: actions/checkout@v4
- name: "Checkout mathlib3"
uses: actions/checkout@v4
with:
repository: leanprover-community/mathlib
path: port-repos/leanprover-community/mathlib
- name: "Checkout lean3"
uses: actions/checkout@v4
with:
repository: leanprover-community/lean
path: port-repos/leanprover-community/lean
- name: Fetch merge base SHA from API
run: |
my_merge_base_cmd="gh api repos/${{ github.repository }}/compare/${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} | jq -r '.merge_base_commit.sha'"
echo "${my_merge_base_cmd}"
my_merge_base="$(eval "${my_merge_base_cmd}")"
printf 'MY_MERGE_BASE_SHA=%s\n' "${my_merge_base}" >> "${GITHUB_ENV}"
- name: Fetch merge base SHA
run: |
git fetch \
--no-tags \
--prune \
--progress \
--no-recurse-submodules \
--depth=1 \
origin "${MY_MERGE_BASE_SHA}"
- name: install Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: install script dependencies
run: |
pip install gitpython
- name: run the script
run: |
python scripts/detect_sha_changes.py "${MY_MERGE_BASE_SHA}" "HEAD"