-
Notifications
You must be signed in to change notification settings - Fork 836
40 lines (37 loc) · 1.31 KB
/
check_tflite_files.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
name: Check TfLite Files
on:
workflow_call:
inputs:
trigger-sha:
required: true
type: string
pr-number:
required: true
type: string
pr-body:
required: true
type: string
secrets:
tflm-bot-token:
required: true
jobs:
check_tflite_files:
runs-on: ubuntu-latest
name: Check PR Modifies TfLite Files
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.trigger-sha }}
- name: Check Files
if: ${{ !contains(inputs.pr-body, 'NO_CHECK_TFLITE_FILES=') }}
run: |
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ inputs.pr-number }}/files"
PR_FILES=$(curl -s -X GET -H "Authorization: Bearer ${{ secrets.tflm-bot-token }}" $URL | jq -r '.[] | .filename')
rm -rf tmp_pull_request_files.txt
echo "${PR_FILES}" >> tmp_pull_request_files.txt
rm -rf .git
echo ${{ secrets.tflm-bot-token }} | docker login ghcr.io -u tflm-bot --password-stdin
docker run --rm -v `pwd`:/tflite-micro -w /tflite-micro ghcr.io/tflm-bot/tflm-ci:latest python3 ci/check_tflite_files.py tmp_pull_request_files.txt
TFLITE_FILE_TEST_STATUS=$?
rm -f tmp_pull_request_files.txt
exit ${TFLITE_FILE_TEST_STATUS}