-
Notifications
You must be signed in to change notification settings - Fork 247
59 lines (54 loc) · 1.91 KB
/
aux.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
57
58
59
name: Repo Check
on:
#workflow_run:
# workflows: ["Pull Request Tests"]
# types:
# - requested
pull_request:
branches:
- develop
env:
app: Accept:application/vnd.github.v3+json
base_url: $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/runs
AUTH: ${{ secrets.GITHUB_TOKEN }}
jobs:
pre:
name: Preprocess
runs-on: ubuntu-20.04
steps:
- name: Share helper id
run: echo -n ${{ github.run_id }} >~/id_file
- uses: actions/cache@v4
with:
path: ~/id_file
key: helperid-${{ github.event.workflow_run.id }}
repocheck:
name: Repo check
runs-on: ubuntu-20.04
steps:
- name: Check up-to-dateness and post comment
run: |
trap 'echo "exit-code=$?" >> "$GITHUB_OUTPUT"' EXIT
head_sha=${{ github.event.pull_request.head.sha }}
head_brc=${{ github.event.pull_request.head.ref }}
head_url=${{ github.event.pull_request.head.repo.html_url }}
git clone -q -b $head_brc $head_url .
git checkout -q $head_sha
git submodule -q update --init --recursive
cd ${{ github.workspace }}/tests/ci
url=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY
pr_number=$(curl -sS -H $app $url/pulls \
| jq -r '.[] | select(.head.sha == "'"$head_sha"'") | .number')
echo "pr_number is $pr_number"
pr_uid=${{ github.event.pull_request.head.repo.owner.login }}
echo "pr_uid is $pr_uid"
./repo_check.sh
#comment="$(./repo_check.sh 2>/dev/null)"
#echo "comment is $comment"
#if [[ -n $comment ]]; then
# curl -sS -X POST -H $app -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# $url/issues/$pr_number/comments -d '{"body": "'"${comment}"'"}'
# echo -n "failure" >~/repocheck_file
#else
# echo -n "success" >~/repocheck_file
#fi