Skip to content

ci: add SKIP_ON_PUSH and SKIP_ON_PR environment variables to build workflow#6794

Merged
PastaPastaPasta merged 2 commits into
dashpay:developfrom
PastaPastaPasta:feature/workflow-skip-environment-variables
Aug 2, 2025
Merged

ci: add SKIP_ON_PUSH and SKIP_ON_PR environment variables to build workflow#6794
PastaPastaPasta merged 2 commits into
dashpay:developfrom
PastaPastaPasta:feature/workflow-skip-environment-variables

Conversation

@PastaPastaPasta
Copy link
Copy Markdown
Member

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:

  • 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.

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 x in all the boxes that apply.

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

…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>
@PastaPastaPasta PastaPastaPasta added this to the 23 milestone Jul 31, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 31, 2025

✅ No Merge Conflicts Detected

This 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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 31, 2025

Walkthrough

A new job named check-skip was added to the GitHub Actions workflow file .github/workflows/build.yml. This job determines whether the build process should be skipped based on the SKIP_ON_PUSH and SKIP_ON_PR environment variables and the event type (push or pull request). The output of this job, a skip flag, is then referenced by the container and container-slim jobs. These two jobs were updated to depend on check-skip and include a conditional execution clause that prevents them from running if the skip flag is set to true. No other jobs or internal logic were changed.

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 details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d89784 and 7417fb9.

📒 Files selected for processing (1)
  • .github/workflows/build.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .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_multiprocess-build / Build source
  • GitHub Check: arm-linux-build / Build source
  • GitHub Check: mac-build / Build source
  • GitHub Check: linux64_fuzz-build / Build source
  • GitHub Check: linux64_ubsan-build / Build source
  • GitHub Check: linux64_sqlite-build / Build source
  • GitHub Check: linux64-build / Build source
  • GitHub Check: win64-build / Build source
  • GitHub Check: linux64_tsan-build / Build source
  • GitHub Check: linux64_nowallet-build / Build source
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-skip boots an ubuntu-latest runner 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’s if::

-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 blanket needs: [check-skip] added to every job
• Overall workflow graph is simpler

Pure-expression gating works because if: is evaluated by the runner manager before a runner is allocated.


30-37: Future-proof the event test – include pull_request

The skip logic currently recognises pull_request_target only:

elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ vars.SKIP_ON_PR }}" != "" ]]; then

If the repo later switches to the safer pull_request trigger, SKIP_ON_PR will 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

📥 Commits

Reviewing files that changed from the base of the PR and between be23e15 and 6d89784.

📒 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

Copy link
Copy Markdown

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 7417fb9

@PastaPastaPasta PastaPastaPasta merged commit 88231b1 into dashpay:develop Aug 2, 2025
26 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants