Skip to content

chore(cicd): Setup build system to work with forks - #868

Open
gmpinder wants to merge 22 commits into
blue-build:mainfrom
gmpinder:main
Open

chore(cicd): Setup build system to work with forks#868
gmpinder wants to merge 22 commits into
blue-build:mainfrom
gmpinder:main

Conversation

@gmpinder

@gmpinder gmpinder commented Aug 27, 2026

Copy link
Copy Markdown
Member

This PR allows other developers to easily fork the CLI repo, build, and publish their own images to test their changes. Several types of changes were made to support this.

Earthfile

By refactoring the Earthfile to make use of EARTH_GIT_PROJECT_NAME built-in arg, we can publish the build image to the user's own container registry. The labels are also updated to make use of this arg so that images are appropriately tied back to the forked repo. Some justfile recipes were also added to make calling them easier in the workflow files.

GHA Workflows

The action workflows were also refactored to consolidate all the repeated jobs defined in each job in test.yml. There were some inputs added to trigger installing certain tools for different test scenarios like docker, qemu, or earthbuild. There is a particular input that gets passed in to make dealing with forks easier called fork_pr, the value of which is calculated from a higher workflow file. This flag is used to flip certain jobs on and off to disable pushing images since fork PR GitHub Action tokens do not appear to have the ability to authorize pushing to either the head repo's registry or the base repo's.

Forks should always be able to build and publish images when not running the jobs in a PR against the main repo.

Integration Test Recipe files

The integration test recipes were originally setup to push to the cli/{test_scenario} image repository. Not every dev will fork to a repo named cli, so I added some logic in the justfile to retrieve the repository name and set it to BB_TEST_IMAGE_NAME. This is then used in the recipes using the environment variable expansion feature (#749) to rename the image to match the dev's name for the forked repo.

GitHub Driver

I found a logic error in the github_driver that was not properly detecting when a build was running in a PR. I made sure to update the logic so that the head of the PR is used when obtaining information about the build to keep in line with the other logic setup above.

Closes #802

@gmpinder gmpinder self-assigned this Aug 27, 2026
@gmpinder
gmpinder marked this pull request as ready for review August 30, 2026 00:35
@gmpinder
gmpinder requested a review from HastD as a code owner August 30, 2026 00:35
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.

[chore] Fix github CI pipeline / ghcr.io authentication issues

1 participant