-
Notifications
You must be signed in to change notification settings - Fork 23
ci: skip tests/clippy/udeps for docs-only changes #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ammario
wants to merge
5
commits into
main
Choose a base branch
from
docs-ci-fast
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1437f3f
ci: skip tests/clippy/udeps for docs-only changes
ammario a8149fd
refactor: use detection job pattern to eliminate if duplication
ammario e9e03a6
Merge branch 'main' into docs-ci-fast
ammario 5a8fe95
fix: ensure required status checks stay green with conditional steps
ammario 7a55a40
refactor: use single required job pattern with DAG dependencies
ammario File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: 'Check Docs Only Changes' | ||
| description: 'Check if only documentation files were changed' | ||
| outputs: | ||
| docs-only: | ||
| description: "True if only documentation files were changed" | ||
| value: ${{ steps.check.outputs.docs_only }} | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Check if only docs changed | ||
| id: check | ||
| shell: bash | ||
| run: | | ||
| # Determine the base SHA for comparison | ||
| if [ "${{ github.event_name }}" = "pull_request" ]; then | ||
| # For PRs, compare against the base branch | ||
| BASE_SHA="${{ github.event.pull_request.base.sha }}" | ||
| FILES_CHANGED=$(git diff --name-only "${BASE_SHA}"...HEAD) | ||
| else | ||
| # For pushes, compare with previous commit | ||
| FILES_CHANGED=$(git diff --name-only HEAD~1...HEAD 2>/dev/null || echo "") | ||
| fi | ||
|
|
||
| # Check if all changed files are in docs/ directory | ||
| if [ -z "$FILES_CHANGED" ]; then | ||
| echo "docs_only=false" >> $GITHUB_OUTPUT | ||
| echo "No files changed" | ||
| elif echo "$FILES_CHANGED" | grep -vE '^docs/' > /dev/null; then | ||
| echo "docs_only=false" >> $GITHUB_OUTPUT | ||
| echo "Non-documentation files changed" | ||
| else | ||
| echo "docs_only=true" >> $GITHUB_OUTPUT | ||
| echo "All changes are in docs/ folder, checks will pass automatically" | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Diff all commits when skipping checks on push
The composite action only compares
HEAD~1...HEADfor push events, so a push containing multiple commits will examine only the last commit. If a developer pushes a code change followed by a documentation change in the same push, the workflow reportsdocs_only=truebased solely on the final commit and all test/clippy/udeps jobs are skipped even though code was modified in the earlier commit. To cover the whole push you need to diffgithub.event.before(or the merge base) againstgithub.sha.Useful? React with 👍 / 👎.