-
-
Notifications
You must be signed in to change notification settings - Fork 18
29 lines (23 loc) · 868 Bytes
/
pr.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
# Run tests for tcl or markdown files modified in this PR.
name: tcl / pr
on: pull_request
jobs:
ci:
runs-on: ubuntu-22.04
steps:
- name: Install Deps
run: |
sudo apt-get update && sudo apt-get -y install tcl-thread
- name: Checkout PR
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Run tests for changed/added exercises
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pr_endpoint=$(jq -r '"repos/\(.repository.full_name)/pulls/\(.pull_request.number)"' "$GITHUB_EVENT_PATH")
gh api "$pr_endpoint/files" --paginate --jq '
.[] |
select(.status == "added" or .status == "modified") |
select(.filename | match("\\.(md|tcl|test)$")) |
.filename
' | xargs -r bash bin/pr