ci: add SKIP_ON_PUSH and SKIP_ON_PR environment variables to build workflow#6794
Conversation
…rkflow Add support for skipping CI builds based on environment variables: - SKIP_ON_PUSH: Skip all builds when set on push events - SKIP_ON_PR: Skip all builds when set on pull request events This provides a quick way to disable CI runs without modifying workflow files directly, useful for maintenance periods or resource management. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
Simplify the implementation by only making container jobs depend on check-skip. Since all other jobs depend on containers (directly or indirectly), the skip logic propagates automatically when containers are skipped, resulting in a much cleaner diff. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughA new job named Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/build.yml (2)
21-38: Avoid the extra runner – compute the “skip” flag with a pure expression
check-skipboots anubuntu-latestrunner simply to decide whether the rest of the workflow should run.
You can save that minute (and the queue slot) by dropping the job and embedding the expression directly in each job’sif::-if: ${{ needs.check-skip.outputs.skip == 'false' }} +if: ${{ !(github.event_name == 'push' && vars.SKIP_ON_PUSH != '') && + !(github.event_name == 'pull_request_target' && vars.SKIP_ON_PR != '') }}Advantages:
• No additional VM start-up per workflow
• No blanketneeds: [check-skip]added to every job
• Overall workflow graph is simplerPure-expression gating works because
if:is evaluated by the runner manager before a runner is allocated.
30-37: Future-proof the event test – includepull_requestThe skip logic currently recognises
pull_request_targetonly:elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ vars.SKIP_ON_PR }}" != "" ]]; thenIf the repo later switches to the safer
pull_requesttrigger,SKIP_ON_PRwill silently stop working.
Consider:elif [[ ("${{ github.event_name }}" == "pull_request" || \ "${{ github.event_name }}" == "pull_request_target") && \ "${{ vars.SKIP_ON_PR }}" != "" ]]; then
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/build.yml(18 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.github/**
📄 CodeRabbit Inference Engine (CLAUDE.md)
Unless specifically prompted, avoid making changes to .github (GitHub workflows and configs)
Files:
.github/workflows/build.yml
🧠 Learnings (5)
📓 Common learnings
Learnt from: kwvg
PR: dashpay/dash#6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to .github/** : Unless specifically prompted, avoid making changes to .github (GitHub workflows and configs)
📚 Learning: applies to .github/** : unless specifically prompted, avoid making changes to .github (github workfl...
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to .github/** : Unless specifically prompted, avoid making changes to .github (GitHub workflows and configs)
Applied to files:
.github/workflows/build.yml
📚 Learning: github actions supports arm64 runners with the labels `ubuntu-latest-arm64` and `linux-arm64` for pu...
Learnt from: PastaPastaPasta
PR: dashpay/dash#6588
File: .github/workflows/release_docker_hub.yml:79-81
Timestamp: 2025-02-19T00:03:39.002Z
Learning: GitHub Actions supports ARM64 runners with the labels `ubuntu-latest-arm64` and `linux-arm64` for public repositories, introduced in January 2025. These runners are specifically designed for ARM64 architecture builds.
Applied to files:
.github/workflows/build.yml
📚 Learning: github actions supports arm64 runners with the label `ubuntu-22.04-arm` for public repositories, int...
Learnt from: PastaPastaPasta
PR: dashpay/dash#6588
File: .github/workflows/release_docker_hub.yml:79-81
Timestamp: 2025-02-19T00:03:39.001Z
Learning: GitHub Actions supports ARM64 runners with the label `ubuntu-22.04-arm` for public repositories, introduced in January 2025. This runner is specifically designed for ARM64 architecture builds.
Applied to files:
.github/workflows/build.yml
📚 Learning: applies to src/fuzz/**/*.{cpp,h,cc,cxx,hpp} : fuzzing harnesses should be placed in src/fuzz/...
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to src/fuzz/**/*.{cpp,h,cc,cxx,hpp} : Fuzzing harnesses should be placed in src/fuzz/
Applied to files:
.github/workflows/build.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: linux64_nowallet-build / Build source
- GitHub Check: linux64_ubsan-build / Build source
- GitHub Check: linux64_sqlite-build / Build source
- GitHub Check: linux64_fuzz-build / Build source
- GitHub Check: linux64-build / Build source
- GitHub Check: win64-build / Build source
- GitHub Check: arm-linux-build / Build source
- GitHub Check: Lint / Run linters
- GitHub Check: x86_64-apple-darwin / Build depends
- GitHub Check: x86_64-pc-linux-gnu_multiprocess / Build depends
Issue being fixed or feature implemented
In DashCoreAutoGuix/dash, it's a pain to see which PRs have successfully CI, because the PR CI cancels the push CI, and GitHub UI interprets a cancel as a fail. This will allow me to configure the CI to only run the CI for the push commit, allow the CI status on the PR page to accurately reflect the true status.
What was done?
Add support for skipping CI builds based on environment variables:
This provides a quick way to disable CI runs without modifying workflow files directly, useful for maintenance periods or resource management.
How Has This Been Tested?
See PastaPastaPasta#37 for this working in my fork.
Breaking Changes
None
Checklist:
Go over all the following points, and put an
xin all the boxes that apply.