diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48f7f93..3f06afc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,29 @@ jobs: commits: uses: vannt-dev/repokeeper/.github/workflows/commitlint.yml@v0 rust: + needs: changes + if: ${{ !cancelled() && needs.changes.outputs.code != 'false' }} uses: vannt-dev/repokeeper/.github/workflows/stack-rust.yml@v0 with: rust-versions: '["stable"]' os: '["ubuntu-latest"]' commands: '["cargo fmt --all --check","cargo clippy --workspace --all-targets -- -D warnings","cargo test --workspace --all-targets","cargo test --workspace --doc"]' + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + outputs: + code: ${{ steps.files.outputs.code }} + steps: + - id: files + env: + GH_TOKEN: ${{ github.token }} + EVENT: ${{ github.event_name }} + PR: ${{ github.event.pull_request.number }} + run: | + code=true + if [ "$EVENT" = pull_request ] && files=$(gh api --paginate "repos/$GITHUB_REPOSITORY/pulls/$PR/files" --jq '.[].filename'); then + printf '%s\n' "$files" + if [ -n "$files" ] && ! printf '%s\n' "$files" | grep -Evq '^([^/]*\.md|docs/.*|LICENSE)$'; then code=false; fi + fi + echo "code=$code" >> "$GITHUB_OUTPUT" diff --git a/.repokeeper.yml b/.repokeeper.yml index ea2b911..4bfa3e7 100644 --- a/.repokeeper.yml +++ b/.repokeeper.yml @@ -21,3 +21,9 @@ modules: - "@vannt-dev" owned: [] stack_options: {} +github: + ci: + skip_when_only: + - "*.md" + - "docs/**" + - LICENSE diff --git a/.repokeeper/lock.json b/.repokeeper/lock.json index 2298ab9..9a2ae5e 100644 --- a/.repokeeper/lock.json +++ b/.repokeeper/lock.json @@ -171,6 +171,19 @@ ] } }, + { + "id": "yaml:.github/workflows/ci.yml#[\"jobs\",\"changes\"]", + "module": "ci", + "hash": "2466a89fb7d82be9933737b9edc251479ccc130f0750365b670609117bc378ef", + "target": { + "kind": "yaml", + "path": ".github/workflows/ci.yml", + "keyPath": [ + "jobs", + "changes" + ] + } + }, { "id": "yaml:.github/workflows/ci.yml#[\"jobs\",\"commits\"]", "module": "ci", @@ -187,7 +200,7 @@ { "id": "yaml:.github/workflows/ci.yml#[\"jobs\",\"rust\"]", "module": "ci", - "hash": "c8dda5573569f573c367a7f60bc6ea4e31311c1a2defea8bb9b126105335d3f2", + "hash": "538800026671e7ec976d7837101bbca0ce78ac1660f0da043867e7faed621bd3", "target": { "kind": "yaml", "path": ".github/workflows/ci.yml",