8000 chore: disable workflows in forks by benoitf · Pull Request #13083 · podman-desktop/podman-desktop · GitHub
[go: up one dir, main page]

Skip to content

Conversation

benoitf
Copy link
Collaborator
@benoitf benoitf commented Jul 7, 2025

What does this PR do?

avoid to spawn jobs in forks and skip them as we don't have access to secrets in forks

Screenshot / video of UI

image

What issues does this PR fix or reference?

fixes #13081

How to test this PR?

  • Tests are covering the bug fix or the new feature

@benoitf benoitf requested a review from a team as a code owner July 7, 2025 15:19
@benoitf benoitf requested review from cdrage, MarsKubeX and axel7083 and removed request for a team July 7, 2025 15:19
Copy link
Contributor
coderabbitai bot commented Jul 7, 2025
📝 Walkthrough

"""

Walkthrough

Conditional expressions were added to several GitHub Actions workflow job definitions across multiple workflow files. These conditions restrict the execution of specific jobs so that they only run when the repository is not a fork (github.event.repository.fork == false). This change disables the affected jobs on forked repositories, where secrets are unavailable, and prevents workflow failures in those environments. No other modifications were made to job steps, environment variables, or permissions, and no changes were made to exported or public code entities.

Assessment against linked issues

Objective Addressed Explanation
Prevent failing GitHub Actions workflows on forks by restricting workflow/job execution to the main repository (podman-desktop/podman-desktop) (#13081)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes were found.
"""


📜 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 366ca36 and 061e597.

📒 Files selected for processing (6)
  • .github/workflows/argos.yaml (1 hunks)
  • .github/workflows/codecov-next.yaml (1 hunks)
  • .github/workflows/e2e-kubernetes-main.yaml (1 hunks)
  • .github/workflows/e2e-main.yaml (3 hunks)
  • .github/workflows/next-build.yaml (1 hunks)
  • .github/workflows/website-next.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/e2e-kubernetes-main.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
  • .github/workflows/argos.yaml
  • .github/workflows/codecov-next.yaml
  • .github/workflows/next-build.yaml
  • .github/workflows/e2e-main.yaml
  • .github/workflows/website-next.yaml
⏰ 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). (12)
  • GitHub Check: typecheck
  • GitHub Check: unit tests / macos-15
  • GitHub Check: unit tests / windows-2022
  • GitHub Check: unit tests / ubuntu-24.04
  • GitHub Check: build website
  • GitHub Check: smoke e2e tests (production)
  • GitHub Check: linter, formatters
  • GitHub Check: smoke e2e tests (development)
  • GitHub Check: macOS
  • GitHub Check: Linux
  • GitHub Check: Windows
  • GitHub Check: take screenshots

🪧 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 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 th 8000 e 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.

@benoitf benoitf requested a review from simonrey1 July 7, 2025 15:19
Copy link
Contributor
@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @benoitf - I've reviewed your changes - here's some feedback:

  • Instead of repeating if: github.repository == 'podman-desktop/podman-desktop' on each job, consider using the built-in github.event.repository.fork flag (e.g. if: not github.event.repository.fork) to skip workflows in forks.
  • You could move the fork-check into a reusable workflow or a common template to avoid duplicating the condition across multiple workflow files.
  • For improved readability and maintainability, you might use if: github.repository_owner == 'podman-desktop' rather than the full repo string.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Instead of repeating `if: github.repository == 'podman-desktop/podman-desktop'` on each job, consider using the built-in `github.event.repository.fork` flag (e.g. `if: not github.event.repository.fork`) to skip workflows in forks.
- You could move the fork-check into a reusable workflow or a common template to avoid duplicating the condition across multiple workflow files.
- For improved readability and maintainability, you might use `if: github.repository_owner == 'podman-desktop'` rather than the full repo string.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor
@simonrey1 simonrey1 left a com 8000 ment

Choose a reason for hiding this comment

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

LGTM, could cause issue if we change the org or the repo name of course but we will look into it

Copy link
Contributor
@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: 1

♻️ Duplicate comments (4)
.github/workflows/next-build.yaml (1)

38-40: Same fork-PR exposure as noted in argos.yaml

The tag job will still execute for PRs opened from forks and fail when secrets are missing.
Apply the improved conditional expression suggested for argos.yaml here as well.

.github/workflows/codecov-next.yaml (1)

33-35: Condition needs the fork-head check

Mirrors the issue already described for argos.yaml; please update accordingly.

.github/workflows/website-next.yaml (1)

44-46: Deployment guard still triggers on fork PRs

Same recommendation as in the first comment—ensure the job is skipped when the PR’s head repo is a fork.

.github/workflows/e2e-kubernetes-main.yaml (1)

56-58: Fork PRs will still hit this job

Please apply the stricter condition proposed for argos.yaml so E2E tests are not started without secrets.

🧹 Nitpick comments (1)
.github/workflows/e2e-main.yaml (1)

180-182: Same fork-guard duplicated – consider a small DRY improvement

The exact if: clause is now repeated in multiple jobs (here and in e2e-tests, mac-update-e2e-test, and other workflows).
Although harmless, centralising the check via:

• a reusable workflow called with workflow_call, or
• a composite action that encapsulates the guard,

would drop duplication and reduce future maintenance overhead.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a580645 and 366ca36.

📒 Files selected for processing (6)
  • .github/workflows/argos.yaml (1 hunks)
  • .github/workflows/codecov-next.yaml (1 hunks)
  • .github/workflows/e2e-kubernetes-main.yaml (1 hunks)
  • .github/workflows/e2e-main.yaml (3 hunks)
  • .github/workflows/next-build.yaml (1 hunks)
  • .github/workflows/website-next.yaml (1 hunks)
⏰ 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). (12)
  • GitHub Check: smoke e2e tests (production)
  • GitHub Check: unit tests / ubuntu-24.04
  • GitHub Check: smoke e2e tests (development)
  • GitHub Check: unit tests / macos-15
  • GitHub Check: unit tests / windows-2022
  • GitHub Check: Windows
  • GitHub Check: macOS
  • GitHub Check: Linux
  • GitHub Check: linter, formatters
  • GitHub Check: typecheck
  • GitHub Check: build website
  • GitHub Check: take screenshots
🔇 Additional comments (2)
.github/workflows/e2e-main.yaml (2)

68-70: Condition correctly prevents E2E job execution on forks

The if: github.repository == 'podman-desktop/podman-desktop' guard is the right, lightweight way to stop this secret-dependent job from spawning in forks.


261-263: Condition mirrors previous jobs and looks good

The fork guard is consistent with other jobs and should behave as intended.

fixes podman-desktop#13081

Signed-off-by: Florent Benoit <fbenoit@redhat.com>
@benoitf
Copy link
Collaborator Author
benoitf commented Jul 7, 2025

I've updated the PR to usegithub.event.repository.fork == false so it should be more robust (copy/paste to other repos, rename the repo, rename the org, etc)

Copy link
Contributor
@simonrey1 simonrey1 left a comment

Choose a reason for hiding this comment

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

LGTM

@benoitf
Copy link
Collaborator Author
benoitf commented Jul 7, 2025

so it works well on forks (it's not launching jobs)

will see if it's working well on the main repository 🤞

@benoitf benoitf enabled auto-merge (rebase) July 7, 2025 15:30
@benoitf benoitf merged commit 1655919 into podman-desktop:main Jul 7, 2025
23 checks passed
@podman-desktop-bot podman-desktop-bot added this to the 1.21.0 milestone Jul 7, 2025
@benoitf
Copy link
Collaborator Author
benoitf commented Jul 7, 2025

jobs are correctly executed in the main repository 🚀

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.

When forking podman-desktop repository, Github attemps to launch failing actions
4 participants
0