Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
sumanthreddy29 committed Mar 6, 2024
1 parent da28f4e commit 0bf3f41
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions .github/workflows/get-changed-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,15 @@ jobs:
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.

- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
- name: Modified files
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
git fetch origin main:main
git diff --name-only --diff-filter=d main~ main
- name: Setup test matrix scenarios
id: setup-matrix-scenarios
run: |
set -eux
matrix=$(echo "${ALL_CHANGED_FILES}" | awk -F'/' '{split($3, file_name, "."); split(file_name[1], cloud_region, "-");region= (length(cloud_region) > 1) ? substr($3, index($3, "-") + 1) : ""; cloud=cloud_region[1]; gsub(".json", "", region); print "{\"cloud\": \"" cloud "\", \"file_name\": \"" file_name[1] "\", " (region != "" ? "\"region\": \"" region "\", " : "") "\"scenario_type\": \"" $1 "\", \"scenario_name\": \"" $2 "\"},"}' | sort | uniq | sed 's/,$/,/')
matrix="${matrix//$'\n'/''}"
echo "matrix_combinations={\"include\": [${matrix%?}]}" >> "$GITHUB_OUTPUT"
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
# - name: Setup test matrix scenarios
# id: setup-matrix-scenarios
# run: |
# set -eux
# matrix=$(echo "${ALL_CHANGED_FILES}" | awk -F'/' '{split($3, file_name, "."); split(file_name[1], cloud_region, "-");region= (length(cloud_region) > 1) ? substr($3, index($3, "-") + 1) : ""; cloud=cloud_region[1]; gsub(".json", "", region); print "{\"cloud\": \"" cloud "\", \"file_name\": \"" file_name[1] "\", " (region != "" ? "\"region\": \"" region "\", " : "") "\"scenario_type\": \"" $1 "\", \"scenario_name\": \"" $2 "\"},"}' | sort | uniq | sed 's/,$/,/')
# matrix="${matrix//$'\n'/''}"
# echo "matrix_combinations={\"include\": [${matrix%?}]}" >> "$GITHUB_OUTPUT"

0 comments on commit 0bf3f41

Please sign in to comment.