Skip to content

Commit

Permalink
fix(GHA/test): don't fail
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherve committed Jan 13, 2024
1 parent a4a4f82 commit b05dc07
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
# Retrieve all charts by default
allChartsPaths=$(find . -maxdepth 2 -type d | grep "charts/" | cut -d "/" -f2-3 | sort --unique)
modifiedChartPaths=$allChartsPaths
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
# Retrieve the list of modified chart names in the pull request
modifiedChartPaths=$(gh pr view ${{ github.event.pull_request.number }} --json files -q '.files[].path' | xargs dirname | grep "^charts/" | cut -d "/" -f1-2 | sort --unique)
else
# Retrieve all charts
modifiedChartPaths=$allChartsPaths
echo "= list of modified chart names from the pull request: $modifiedChartPaths"
fi
# Test all charts if this workflow is modified
modifiedWorkflow=$(gh pr view ${{ github.event.pull_request.number }} --json files -q '.files[].path' | grep ".github/workflows/test.yml")
if [ -n "${modifiedWorkflow}" ]; then
modifiedChartPaths=$allChartsPaths
echo "= workflow modified, including all charts"
fi
# Keep only modified charts with unit tests
Expand Down

0 comments on commit b05dc07

Please sign in to comment.