From 6fb82e1571cb2c54b76a38e50e2b81b4d3f97a72 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 17 Mar 2025 13:02:24 -0700 Subject: [PATCH] docs: update README example --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ef75b08..cd64a3f 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,13 @@ jobs: steps: - name: Check for any changed workflows id: check-for-changed-workflows - uses: tj-actions/changed-files@v41 - with: - files: | - .github/workflows/**.yml + run: | + CHANGED_WORKFLOWS=$(gh api repos/${{ github.event.pull_request.base.repo.full_name }}/pulls/${{ github.event.pull_request.number }}/files --jq '.[] | select((.filename | match("^.github/workflows/.*.yml$")) and (.status != "removed")) | .filename') + if [[ -n "$CHANGED_WORKFLOWS" ]]; then + echo "any_changed=true" >> $GITHUB_OUTPUT + else + echo "any_changed=false" >> $GITHUB_OUTPUT + fi - name: Validate workflows if: steps.check-for-changed-workflows.outputs.any_changed == 'true' uses: dsanders11/json-schema-validate-action