forked from VSCodium/vscodium
-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcheck_cron_or_pr.sh
executable file
·38 lines (30 loc) · 920 Bytes
/
check_cron_or_pr.sh
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
#!/usr/bin/env bash
# shellcheck disable=SC2129
set -e
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
echo "It's a PR"
export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
echo "It's a Push"
export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
if [[ "${GENERATE_ASSETS}" == "true" ]]; then
echo "It will generate the assets"
export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
else
echo "It's a Dispatch"
export SHOULD_DEPLOY="yes"
fi
else
echo "It's a Cron"
export SHOULD_DEPLOY="yes"
fi
if [[ "${GITHUB_ENV}" ]]; then
echo "GITHUB_BRANCH=${GITHUB_BRANCH}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD=${SHOULD_BUILD}" >> "${GITHUB_ENV}"
echo "SHOULD_DEPLOY=${SHOULD_DEPLOY}" >> "${GITHUB_ENV}"
echo "VSCODE_QUALITY=${VSCODE_QUALITY}" >> "${GITHUB_ENV}"
fi