-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_commit_getter.sh
More file actions
executable file
·54 lines (44 loc) · 1.32 KB
/
run_commit_getter.sh
File metadata and controls
executable file
·54 lines (44 loc) · 1.32 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
#!/bin/bash
#load environment variables from the .env file
if [ -f .env ]; then
source .env
else
echo ".env file not found."
exit 1
fi
#check if the 'repos' environment variable is set
if [ -z "$REPOS" ]; then
echo "The 'REPOS' environment variable is not set."
exit 1
fi
#check if the 'BRANCHES' environment variable is set
if [ -z "$BRANCHES" ]; then
echo "The 'BRANCHES' environment variable is not set."
exit 1
fi
if [ -z "$GITHUB_TOKEN" ]; then
echo "The 'GITHUB_TOKEN' environment variable is not set."
exit 1
fi
if [ -z "$GITHUB_USERNAME" ]; then
echo "The 'GITHUB_USER' environment variable is not set."
exit 1
fi
if [ -z "$PYTHON_EXECUTABLE" ]; then
echo "The 'PYTHON_EXECUTABLE' environment variable is not set."
exit 1
fi
#split the 'repos' variable by '+' and iterate over each repo
IFS='+' read -ra REPO_ARRAY <<< "$REPOS"
IFS='+' read -ra BRANCH_ARRAY <<< "$BRANCHES"
#check if the counts of repos and branches match
if [ ${#REPO_ARRAY[@]} -ne ${#BRANCH_ARRAY[@]} ]; then
echo "The number of repositories and branches do not match."
exit 1
fi
for i in "${!REPO_ARRAY[@]}"; do
repo=${REPO_ARRAY[i]}
branch=${BRANCH_ARRAY[i]}
echo "Running commit-getter for repository: $repo with branch: $branch"
$PYTHON_EXECUTABLE commit-getter.py "$repo" "$branch"
done