Skip to content

Source branch validation - #1161

Closed
CringeCursed wants to merge 4 commits into
ss14Starlight:starlight-devfrom
CringeCursed:Source-branch-validation
Closed

Source branch validation#1161
CringeCursed wants to merge 4 commits into
ss14Starlight:starlight-devfrom
CringeCursed:Source-branch-validation

Conversation

@CringeCursed

Copy link
Copy Markdown
Member

Short description

Add GitHub Actions workflow to validate that PR branches are created from starlight-dev

Why we need to add this

This PR adds a new GitHub Actions workflow that enforces proper branch management by validating the source of pull request branches. The workflow uses git history analysis to ensure branches are properly derived from starlight-dev.

Technical implementation:

  • Uses git merge-base to find the common ancestor between the PR branch and starlight-dev
  • Performs two-step validation:
    • Checks if the base commit is an ancestor of starlight-dev
    • Verifies the base commit is also an ancestor of the current starlight-dev HEAD
  • On validation failure:
    • Automatically adds a comment with rebase instructions using actions/github-script
  • Uses fetch-depth: 0 to ensure full git history is available for accurate ancestry checking

The strict ancestry checking ensures that branches haven't diverged from an old version of starlight-dev

Media (Video/Screenshots)

Checks

  • I do not require assistance to complete the PR.
  • Before posting/requesting review of a PR, I have verified that the changes work.
  • I have added screenshots/videos of the changes, or this PR does not change in-game mechanics.
  • I affirm that my changes are licensed under the Starlight Fork License and grant permission for use in this repository under its conditions.

Changelog
🆑 Cringe_Cursed

  • add: Added GitHub Actions workflow for validating PR branch origins against starlight-dev

@github-actions github-actions Bot added size/S S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. Changes: No C# and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Jul 31, 2025
@CringeCursed

Copy link
Copy Markdown
Member Author

SB55oIPPAXc

@CringeCursed

Copy link
Copy Markdown
Member Author

yappy 😀

@Conflee

Conflee commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

Originate from starlight-dev or are being PRed TO starlight-dev? If its the first I am never PRing again because I can't get that working.

@CringeCursed

Copy link
Copy Markdown
Member Author

Originate from starlight-dev or are being PRed TO starlight-dev? If its the first I am never PRing again because I can't get that working.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changes: No C# S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants