Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(automation): Add Check to ensure only next moves code to prod (
#5676) * Rename test workflow and clean up code The test workflow file has been renamed to 'on-pr.yml' to better reflect its usage. Extra space within the workflow file has also been removed for neatness and readability. * Add Github action to validate PR source branch This commit introduces a new Github Action workflow that checks the source branch of pull requests. The action ensures that only changes from the "next" branch can enter the "prod" branch. * Add validation for branch names in Github action In the "on-pr-change" Github action, additional validation checks have been added to ensure the HEAD_REF and BASE_REF branch names do not contain invalid characters. Now, the script checks for invalid characters in branch names and restricts merge requests to the prod branch only from the next branch. * Refactor branch character check in workflow file Removed the previously defined environmental variables for checking branch names in the .github/workflows/on-pr-change.yml file. The branch character validation has been removed as this is already done by Github. The same check was simplified using Github context variables directly. * Update branch check logic in Github Actions workflow The commit adds environment variables to store HEAD_REF and BASE_REF in the Github Actions workflow for checking branches in .github/workflows/on-pr-change.yml file. Using these variables should improve the readability and maintainability of the branch comparison logic. * Refactored GitHub Actions workflow conditions The commit refactors the conditional check in the on-pr-change.yml GitHub Actions workflow. It introduces new variables: HEAD and BASE to replace the direct usage of env.HEAD_REF and env.BASE_REF in the condition check, enhancing readability and maintainability. * Simplify conditional statement in GitHub Action This commit streamlines the conditional statement in the on-pr-change.yml GitHub Action script. The previous version unnecessarily assigned HEAD_REF and BASE_REF environment variables to local variables, which were subsequently used in the branch comparison checks. The updated version directly uses these environment variables. * Update .github/workflows/on-pr.yml --------- Co-authored-by: Richard Fontein <[email protected]>
- Loading branch information