From 9e1f49d2ff0961932f6c744a9deea66e8eb6a091 Mon Sep 17 00:00:00 2001 From: MASES Public Developers Team <94312179+masesdevelopers@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:22:55 +0100 Subject: [PATCH] Update workflows to better filter changes, removed edited trigger from release.yaml (#221) --- .github/workflows/build.yaml | 7 ++++++- .github/workflows/codeql-analysis.yml | 7 ++++++- .github/workflows/pullrequest.yaml | 11 ++++++++--- .github/workflows/release.yaml | 2 +- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b4215ba9..e2631bef 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,7 +31,12 @@ jobs: echo "run_build_windows=true" >> $GITHUB_OUTPUT break fi - if [[ $added_modified_file == "src/"* ]]; then + if [[ $added_modified_file == "src/net/"* ]]; then + echo "$added_modified_file file is under the directory 'src/'." + echo "run_build_windows=true" >> $GITHUB_OUTPUT + break + fi + if [[ $added_modified_file == "test/"* ]]; then echo "$added_modified_file file is under the directory 'src/'." echo "run_build_windows=true" >> $GITHUB_OUTPUT break diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c4aac7fd..faa17658 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,7 +37,12 @@ jobs: run: | mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.get_changed_files.outputs.added_modified }}') for added_modified_file in "${added_modified_files[@]}"; do - if [[ $added_modified_file == "src/"* ]]; then + if [[ $added_modified_file == "src/net/"* ]]; then + echo "$added_modified_file file is under the directory 'src/'." + echo "run_build_windows=true" >> $GITHUB_OUTPUT + break + fi + if [[ $added_modified_file == "test/"* ]]; then echo "$added_modified_file file is under the directory 'src/'." echo "run_build_windows=true" >> $GITHUB_OUTPUT break diff --git a/.github/workflows/pullrequest.yaml b/.github/workflows/pullrequest.yaml index 82e6750a..43aae26d 100644 --- a/.github/workflows/pullrequest.yaml +++ b/.github/workflows/pullrequest.yaml @@ -24,12 +24,17 @@ jobs: run: | mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.get_changed_files.outputs.added_modified }}') for added_modified_file in "${added_modified_files[@]}"; do - if [[ $added_modified_file == ".github/workflows/build.yaml"* ]]; then - echo "$added_modified_file is myself." + if [[ $added_modified_file == ".github/workflows/pullrequest.yaml"* ]]; then + echo "$added_modified_file file changed" echo "run_build_windows=true" >> $GITHUB_OUTPUT break fi - if [[ $added_modified_file == "src/"* ]]; then + if [[ $added_modified_file == "src/net/"* ]]; then + echo "$added_modified_file file is under the directory 'src/'." + echo "run_build_windows=true" >> $GITHUB_OUTPUT + break + fi + if [[ $added_modified_file == "test/"* ]]; then echo "$added_modified_file file is under the directory 'src/'." echo "run_build_windows=true" >> $GITHUB_OUTPUT break diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 53709f3c..18d0ec72 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,7 +8,7 @@ on: release: types: - published - - edited +# - edited jobs: # This workflow contains a single job called "build_release"