Skip to content

Commit

Permalink
fix: revert to new logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dg1223 committed Aug 5, 2023
1 parent 8f901b0 commit 1c83e7e
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/ci-cd-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,33 @@ jobs:
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }})
echo ${CHANGED_FILES}
# # Define the regular expression pattern for allowed file types
# SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$"
# echo ${SKIP_FILE_TYPES}
# Define the regular expression pattern for allowed file types
SKIP_FILE_TYPES="^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$"
echo ${SKIP_FILE_TYPES}
# # Check if there are any changed files that are not allowed
# VALID_CHANGES=$(echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}")
# echo ${VALID_CHANGES}
# Check if there are any changed files that are not allowed
VALID_CHANGES=$(echo "${CHANGED_FILES}" | grep -Ev "${SKIP_FILE_TYPES}")
echo ${VALID_CHANGES}
# if [ -n "${VALID_CHANGES}" ]; then
# echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow."
# echo "run_jobs=true" >> ${GITHUB_OUTPUT}
# else
# echo "Only README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle files have been updated. Skipping the CI/CD workflow."
# echo "run_jobs=false" >> ${GITHUB_OUTPUT}
# fi
# Check if 'README.md' or '.yml' files are the only files changed
if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)).*$ ]]; then
echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow."
# GITHUB_OUTPUT is a default GitHub env. variable
echo "run_jobs=false" >> ${GITHUB_OUTPUT}
else
echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow."
if [ -n "${VALID_CHANGES}" ]; then
echo "Changes to files other than README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle detected. Proceeding with the CI/CD workflow."
echo "run_jobs=true" >> ${GITHUB_OUTPUT}
else
echo "Only README.md, *.yml, .txt, .gitattributes, .gitignore, or .gradle files have been updated. Skipping the CI/CD workflow."
echo "run_jobs=false" >> ${GITHUB_OUTPUT}
fi
# # Check if 'README.md' or '.yml' files are the only files changed
# if [[ ${CHANGED_FILES} =~ ^(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)$ && ! ${CHANGED_FILES} =~ ^(?!.*(README\.md|.*\.yml|.*\.txt|\.gitattributes|\.gitignore|.*\.gradle)).*$ ]]; then
# echo "Only README.md or .yml or .txt files have been updated. Skipping the CI/CD workflow."
# # GITHUB_OUTPUT is a default GitHub env. variable
# echo "run_jobs=false" >> ${GITHUB_OUTPUT}
# else
# echo "Changes to files other than README.md or *.yml or .txt detected. Proceeding with the CI/CD workflow."
# echo "run_jobs=true" >> ${GITHUB_OUTPUT}
# fi
test:
needs: check_readme_yml_txt_changes
if: needs.check_readme_yml_txt_changes.outputs.run_rest_jobs == 'true'
Expand Down

0 comments on commit 1c83e7e

Please sign in to comment.