vscodium/check_cron_or_pr.sh

29 lines
598 B
Bash
Raw Normal View History

2021-03-10 18:48:45 +03:00
#!/bin/bash
set -e
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
2021-03-10 18:56:14 +03:00
echo "It's a PR"
2022-08-16 14:51:45 +03:00
export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
echo "It's a Push"
2022-08-16 14:51:45 +03:00
2021-03-10 18:48:45 +03:00
export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
2022-08-16 14:51:45 +03:00
elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
echo "It's a Dispatch"
export SHOULD_DEPLOY="yes"
2021-03-10 18:48:45 +03:00
else
2022-08-16 14:51:45 +03:00
echo "It's a Cron"
2021-03-10 18:48:45 +03:00
export SHOULD_DEPLOY="yes"
fi
if [[ "${GITHUB_ENV}" ]]; then
echo "SHOULD_BUILD=${SHOULD_BUILD}" >> "${GITHUB_ENV}"
echo "SHOULD_DEPLOY=${SHOULD_DEPLOY}" >> "${GITHUB_ENV}"
2022-08-16 14:51:45 +03:00
fi