vscodium/check_cron_or_pr.sh

39 lines
921 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# shellcheck disable=SC2129
2021-03-10 10:48:45 -05:00
set -e
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
2021-03-10 10:56:14 -05:00
echo "It's a PR"
2022-08-16 07:51:45 -04:00
2024-02-22 07:34:57 -05:00
export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
echo "It's a Push"
2022-08-16 07:51:45 -04:00
2021-03-10 10:48:45 -05:00
export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
2022-08-16 07:51:45 -04:00
elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
2023-12-16 18:30:20 -05:00
if [[ "${GENERATE_ASSETS}" == "true" ]]; then
echo "It will generate the assets"
2022-08-16 07:51:45 -04:00
export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
else
echo "It's a Dispatch"
export SHOULD_DEPLOY="yes"
fi
2021-03-10 10:48:45 -05:00
else
2022-08-16 07:51:45 -04:00
echo "It's a Cron"
2021-03-10 10:48:45 -05:00
export SHOULD_DEPLOY="yes"
fi
if [[ "${GITHUB_ENV}" ]]; then
2022-10-23 13:53:10 -04:00
echo "GITHUB_BRANCH=${GITHUB_BRANCH}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD=${SHOULD_BUILD}" >> "${GITHUB_ENV}"
echo "SHOULD_DEPLOY=${SHOULD_DEPLOY}" >> "${GITHUB_ENV}"
2022-10-23 13:53:10 -04:00
echo "VSCODE_QUALITY=${VSCODE_QUALITY}" >> "${GITHUB_ENV}"
2022-08-16 07:51:45 -04:00
fi