-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
68 lines (56 loc) · 1.73 KB
/
Copy pathaction.yml
File metadata and controls
68 lines (56 loc) · 1.73 KB
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
60
61
62
63
64
65
66
67
name: 'Trustworthy Systems CI'
description: |
Useful common configuration and scripts for the Trustworthy Systems CI.
inputs:
path:
description: path to clone this repo relative to GITHUB_WORKSPACE
default: systems-ci
required: false
token:
description: github access token used to fetch the API to prevent rate limiting errors
default: ${{ github.token }}
required: false
runs:
using: "composite"
steps:
- name: Checkout the systems-ci repository
uses: actions/checkout@v4
with:
repository: au-ts/systems-ci
path: ${{ inputs.path }}
- name: Update systems-ci with 'test with' description
if: ${{ github.event_name == 'pull_request' }}
run: |
PRS="$(${{ inputs.path }}/scripts/get-prs)"
echo Checking out $PRS
for PR in ${PRS}; do
REPO=${PR%#*}
ID=${PR#*#}
REPO_PATH="github.com/${REPO}.git"
if [ -n "${GITHUB_TOKEN}" ]
then
URL="https://${GITHUB_TOKEN}@${REPO_PATH}"
REPO_PATH="token@${REPO_PATH}"
else
URL="https://${REPO_PATH}"
fi
REF="refs/pull/${ID}/head"
if [ "$REPO" == "au-ts/systems-ci" ]; then
REPO_PATH=${{ inputs.path }}
echo "Fetching ${REF} from ${REPO_PATH}"
else
echo "Skipping ${REF}"
continue
fi
cd "$REPO_PATH"
git fetch -q --depth 1 ${URL} ${REF}:${REF}
git checkout -q ${REF}
cd - > /dev/null
done
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}
# this relies on writes to GITHUB_ENV
- name: Setup ts_ci
run: ${{ inputs.path }}/setup.sh
shell: bash