Add test_mode var, update use of vars in strings

This commit is contained in:
GH Action - Upstream Sync
2021-07-18 15:45:15 -05:00
parent d192d3cf58
commit 8678c740a1
5 changed files with 13 additions and 12 deletions
+5
View File
@@ -58,6 +58,11 @@ inputs:
required: true
default: 'false'
test_mode:
description: If set to 'true', runs verification test on all inputs and any testable actions that use them
required: true
default: 'false'
outputs:
has_new_commits:
description: 'true when new commits were included in this sync'
+3 -6
View File
@@ -4,17 +4,14 @@
. ../util/output.sh
# TODO: SPIKE on 'live' tests through the action runner
# TODO: set -e?? -- no, please handle all errors && exits
if [ -z "${GITHUB_ACTIONS}" ] || [ "${GITHUB_ACTIONS}" = false ]; then
write_out "b" "\nRunning in LOCAL MODE..."
# TODO: set test mode in the yaml workflow
# set test mode here
INPUT_TEST_MODE=true
# set test mode, default false
INPUT_TEST_MODE=false
# region vars
# TODO: explain local var settings use here
# The Github login of the user initiating the workflow run
# Github login of the user initiating the workflow run
GITHUB_ACTOR="aormsby"
# required vars (except token)
+1 -1
View File
@@ -18,7 +18,7 @@ async function main() {
};
// options.cwd = './lib';
await exec.exec('sh', [__dirname + '/config_and_run.sh'], options);
await exec.exec('sh', [__dirname + '/entry/config_and_run.sh'], options);
} catch (error) {
core.setFailed(error.message);
+3 -4
View File
@@ -2,8 +2,7 @@
test_target_branch_exists() {
write_out "y" "TEST"
# TODO: change displayed input var names based on final revisions
write_out -1 "[Verify Target Sync Branch] -> target_branch must exist"
write_out -1 "[Verify Source Sync Branch] -> tests 'source_sync_branch' input"
VERIFY_TARGET_BRANCH=$(git rev-parse --verify "refs/heads/${INPUT_SOURCE_SYNC_BRANCH}")
if [ -z "${VERIFY_TARGET_BRANCH}" ]; then
@@ -15,7 +14,7 @@ test_target_branch_exists() {
test_upstream_repo_exists() {
write_out "y" "TEST"
write_out -1 "[Verify Upstream Repo Exists] -> upstream_repository must exist"
write_out -1 "[Verify Upstream Sync Repo Exists] -> tests 'upstream_sync_repo' input"
VERIFY_TARGET_REPO=$(git ls-remote "${UPSTREAM_REPO_URL}")
if [ -z "${VERIFY_TARGET_REPO}" ]; then
@@ -28,7 +27,7 @@ test_upstream_repo_exists() {
test_upstream_branch_exists() {
write_out "y" "TEST"
write_out -1 "[Verify Upstream Branch] -> upstream_branch must exist"
write_out -1 "[Verify Upstream Sync Branch Exists] -> tests 'upstream_sync_branch' input"
VERIFY_UPSTREAM_BRANCH=$(git ls-remote "${UPSTREAM_REPO_URL}" --refs "${INPUT_UPSTREAM_SYNC_BRANCH}")
if [ -z "${VERIFY_UPSTREAM_BRANCH}" ]; then
+1 -1
View File
@@ -61,5 +61,5 @@ write_out() {
early_exit_cleanup() {
reset_git_config
# TODO: set fail output var here?
# TODO: set action fail output var here?
}