Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: "Changed directories" don't parse all directories correctly #21

Open
garciagenrique opened this issue Jul 26, 2023 · 0 comments
Open
Assignees

Comments

@garciagenrique
Copy link
Member

This only happens when changes in vre-singleuser and vre-singleuser-* directories happen simultaneously.

Why ?
Github Actions variables are not real bash objects.

Priority ?
Low. Users are not expected to change vre-singleuser, thus this situation will rarely happen.

example of issue: https://github.com/vre-hub/environments/actions/runs/5659959759/job/15334606680

environments=()
  for dir in vre-singleuser-py38 vre-singleuser-root vre-singleuser; do
    echo "$dir was changed"
    if [[ $(echo ${environments[@]} | fgrep -w ${dir}) ]]; then
      echo " - ${dir} is in the list of changed dirs"
    else
      echo " - ${dir} is NOT in the list of changed dirs. Adding it!"
      environments+=("\"${dir}\"")
      echo " ** The update list is ${environments[@]}"
    fi        
  done
  
  ENVS_LIST=`echo "[${environments[@]}]" |  sed 's/ /,/g'`
  echo ::set-output name=environment_list::$ENVS_LIST
  
  echo "The final list is: ${ENVS_LIST}"

Will give as output

vre-singleuser-py38 was changed
 - vre-singleuser-py38 is NOT in the list of changed dirs. Adding it!
 ** The update list is "vre-singleuser-py38"
vre-singleuser-root was changed
 - vre-singleuser-root is NOT in the list of changed dirs. Adding it!
 ** The update list is "vre-singleuser-py38" "vre-singleuser-root"
vre-singleuser was changed
 - vre-singleuser is in the list of changed dirs
The final list is: ["vre-singleuser-py38","vre-singleuser-root"]

vre-singleuser is NOT a substring of vre-singleuser-py38 when run on bash.

@garciagenrique garciagenrique self-assigned this Jul 26, 2023
@garciagenrique garciagenrique changed the title Changed directories don't parse all directories correctly CI: "Changed directories" don't parse all directories correctly Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant