This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 295
54 lines (46 loc) · 1.83 KB
/
add_ported_warnings.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
name: Add mathlib4 porting warnings
on:
pull_request:
jobs:
build:
name: Check for modifications to ported files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: install latest mathlibtools
run: |
pip install git+https://github.com/leanprover-community/mathlib-tools
# TODO: is this really faster than just calling git from python?
- name: Get changed files
id: changed-files
uses: Ana06/[email protected]
- name: run the script
id: script
run: |
python scripts/detect_ported_files.py ${{ steps.changed-files.outputs.all }}
- id: PR
uses: 8BitJonny/[email protected]
# TODO: this may not work properly if the same commit is pushed to multiple branches:
# https://github.com/8BitJonny/gh-get-current-pr/issues/8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ github.event.pull_request.head.sha }}
# Only return if PR is still open
filterOutClosed: true
- if: steps.script.outputs.modifies_ported == 'True'
id: add_label
name: add "modifies-synchronized-file"
# we use curl rather than octokit/request-action so that the job won't fail
# (and send an annoying email) if the labels don't exist
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ steps.PR.outputs.number }}/labels \
-d '{"labels":["modifies-synchronized-file"]}'