forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactionlint.sh
More file actions
executable file
·25 lines (20 loc) · 800 Bytes
/
Copy pathactionlint.sh
File metadata and controls
executable file
·25 lines (20 loc) · 800 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
AVALANCHE_PATH="$(cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )"
"${AVALANCHE_PATH}"/scripts/run_tool.sh actionlint "${@}"
echo "Checking use of scripts/* in GitHub Actions workflows..."
SCRIPT_USAGE=
for file in "${AVALANCHE_PATH}"/.github/workflows/*.{yml,yaml}; do
# Skip if no matches found (in case one of the extensions doesn't exist)
[[ -f "$file" ]] || continue
# Search for scripts/* except for scripts/run_task.sh
MATCHES=$(grep -H -n -P "scripts/(?!run_task\.sh)" "$file" || true)
if [[ -n "${MATCHES}" ]]; then
echo "${MATCHES}"
SCRIPT_USAGE=1
fi
done
if [[ -n "${SCRIPT_USAGE}" ]]; then
echo "Error: the lines listed above must be converted to use scripts/run_task.sh to ensure local reproducibility."
exit 1
fi