Update charts-release.yaml

Signed-off-by: Kjeld Schouten <info@kjeldschouten.nl>
This commit is contained in:
Kjeld Schouten
2024-10-19 20:50:06 +02:00
committed by GitHub
parent 985d01864e
commit cd9553836a
+14 -4
View File
@@ -32,14 +32,24 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Check for changes in specific folders - name: Check for changes in specific folders and README.md files
id: check_changes id: check_changes
run: | run: |
if git diff --exit-code HEAD^ HEAD -- website/ **/docs **/README.md; then # If this is a pull request, fetch the base branch
echo "No changes detected in the specified folders." if [ "${{ github.event_name }}" == "pull_request" ]; then
git fetch origin ${{ github.event.pull_request.base.ref }}
BASE_COMMIT="origin/${{ github.event.pull_request.base.ref }}"
else
# For workflow_call, use the default behavior (current commit)
BASE_COMMIT="${{ github.sha }}^" # Compare against the previous commit
fi
# Compare changes
if git diff --exit-code $BASE_COMMIT...${{ github.sha }} -- website/ **/docs **/README.md; then
echo "No changes detected in the specified folders or README.md files."
echo "::set-output name=changes_detected::false" echo "::set-output name=changes_detected::false"
else else
echo "Changes detected in the specified folders." echo "Changes detected in the specified folders or README.md files."
echo "::set-output name=changes_detected::true" echo "::set-output name=changes_detected::true"
fi fi