Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PARENT_BRANCH detection doesn't work with default actions/checkout #25

Open
emteknetnz opened this issue Jul 3, 2022 · 0 comments
Open

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Jul 3, 2022

Parent branch detection is currently implemented on gha-generate-matrix to get the parent branch on pull-requests only. This isn't required pull-request targets following the standard branch naming convention. The original intention was to use this to work out which version of installer to use, though this still wouldn't work for non-lockedstepped modules. For non-lockedstepped modules, they should have no issues working with the latest minor of installer, however the version of php used does matter in the case of php 8.1, so limiting to installer 4.10.x-dev is sometimes desirable.

The actual use case for getting the parent branch is fairly limited, it's for running CI on push events on forked repos when the common naming convention isn't used, for example myaccount-patch-1. One solution would be to add a step on gha-generate-matrix

===

Old description:

In gha-ci + gha-generate-matrix, parent branch detection does seem to work, presumably because actions/checkout on retrieves the latest commit by default

PARENT_BRANCH was put in place to work out COMPOSER_ROOT_VERSION on push events on forked repos

Options include:

  • !change the fetch-depth of actions/checkout to 0 to retrieve all commits (framework will suffer the worst)
  • change the fetch-depth to 10 or 20 and assume that it covers all commits in any non-squashed pull-request
  • somehow retrieve this information from the github api (unlikely to work)
  • (probably the best approach) use the github api to pull the latest minor version of the repo, and set COMPOSER_ROOT_VERSION to that. If a fork points to say 4.10, and the latest version is 4.11, it's very unlikely that using installer 4.11 is going to break the fork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants