How to clone a right helm chart source in the case when helm chart referenced in a helm release being tested by hrval-action is located in the same git repository, where hrval-action is run ?
In case of pull request, if a pull request base repository branch is referenced in helm release, hrval-action might be executed against invalid version of helm chart source, other than one contained in head repository branch.
Algorithm:
when HRVAL_BASE_BRANCH and HRVAL_HEAD_BRANCH environment variables are set, for each helm chart being tested,
detect if Helm Release chart reference contains link to a repository where hrval-action currently runs and the ref specified equals to value specified in HRVAL_BASE_BRANCH environment variable
if such Helm Release have been encountered, fetch chart source from git ref specified in HRVAL_HEAD_BRANCH environment variable
otherwise, proceed with original ref setting
This patch is non-intrusive, and a pre-patch behavior will be executed in case if HRVAL_BASE_BRANCH and HRVAL_HEAD_BRANCH variables are not set.
This is based on https://github.com/stefanprodan/hrval-action/pull/33 and intended to solve the same problem.
How to clone a right helm chart source in the case when helm chart referenced in a helm release being tested by
hrval-action
is located in the same git repository, wherehrval-action
is run ?In case of pull request, if a pull request base repository branch is referenced in helm release,
hrval-action
might be executed against invalid version of helm chart source, other than one contained in head repository branch.Algorithm:
HRVAL_BASE_BRANCH
andHRVAL_HEAD_BRANCH
environment variables are set, for each helm chart being tested,hrval-action
currently runs and theref
specified equals to value specified inHRVAL_BASE_BRANCH
environment variableHRVAL_HEAD_BRANCH
environment variableref
settingThis patch is non-intrusive, and a pre-patch behavior will be executed in case if
HRVAL_BASE_BRANCH
andHRVAL_HEAD_BRANCH
variables are not set.