Skip to content

Enable depends-on for GitHub Actions#201

Draft
castler wants to merge 1 commit intomainfrom
js_depends_on
Draft

Enable depends-on for GitHub Actions#201
castler wants to merge 1 commit intomainfrom
js_depends_on

Conversation

@castler
Copy link
Contributor

@castler castler commented Mar 17, 2026

With this we enable, that Pull-Requests will be build upon each other with a rebase.

Depends-On-NOT: #203

pr_number = os.environ.get("PR_NUMBER", "")
output_path = os.environ.get("GITHUB_OUTPUT", os.devnull)

if event_name not in ("pull_request", "merge_group"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Having merge_group here is quite risky. What if one of the PRs is not merged to the target branch?GitHub does not merge what you check out in the merge queue. It only merges the PR of the event.

This would break the target branch. Please remove the merge_group.

pr_number = os.environ.get("PR_NUMBER", "")
output_path = os.environ.get("GITHUB_OUTPUT", os.devnull)

if event_name not in ("pull_request", "merge_group"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add pull_request_target to also support our QNX workflows.
And we might want to consider workflow_run events as well.


def test_surrounding_text(self):
self.assertEqual(
parse_depends_on("Please merge Depends-On: #1111 first before this one"), ["1111"]
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer if we enforce that there may be no other text in the same line before the Depends-On.
Text after is a nice feature for commenting the dependencies.


def test_merge_group_event_runs(self):
code, output = self._run_main(
{"EVENT_NAME": "merge_group", "PR_NUMBER": "123"},
Copy link
Contributor

Choose a reason for hiding this comment

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

We need an additional workflow that verifies that all dependencies are merged before we put a PR in the merge queue. E.g. the Check is only green when all dependencies are merged.

Comment on lines +64 to +69
DEPENDENCY_PRS: ${{ steps.find-dependency.outputs.dependency_prs }}
DEPENDENCY_COUNT: ${{ steps.find-dependency.outputs.dependency_count }}
REBASED: ${{ steps.rebase.outputs.rebased }}
REBASED_COUNT: ${{ steps.rebase.outputs.rebased_count }}
SKIPPED_PRS: ${{ steps.rebase.outputs.skipped_prs }}
FAILED_PRS: ${{ steps.rebase.outputs.failed_prs }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs default values if you have the always flag. Some of these outputs might not be there.

With this we enable, that Pull-Requests will be build upon each other with a rebase.
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