platformsh / gha-prep-for-autopr

Preps a repository to allow for auto-merging of pull requests.
1 stars 0 forks source link

Update default value for status-checks #6

Open gilzow opened 1 year ago

gilzow commented 1 year ago

With the change over to reusable workflows, the name of the default check we want to perform will need to be changed as well.

The new name takes the form of the job name property in the calling workflow (TestPREnvironment-RW) a slash / and then the job name property in the reusable workflow (TestPrEnvironment).

E.g. 'TestPREnvironment-RW / TestPrEnvironment'

This is somewhat brittle since if we (or someone else in an individual template) change(s) the name property in the calling workflow, our default here will no longer be a valid status check name. However, since most our templates will be starting from a base collection of workflows they should have the correct calling workflow job name to begin with.

Alternatively, we don't worry about it since we allow passing in the status check names to set (via status-checks input) and the reusable workflow is already using this input to hand in the above example. We could instead allow an input in the autopr reusable workflow for a status check name that we then hand to this github action.

gilzow commented 1 year ago

Correction: the syntax is the job name if available OR the job id if the name property for the job is not set. While we can retrieve the job id via ${{ github.job }} the name property of a job is currently not an accessible item in the GitHub Actions platform.

Therefore, the suggestion is to remove the name property from both the calling workflow and the reusable workflow and set the status-check passed into this action equal to those two IDs. For this GH action, I think we can set the default to be equal to the default values of those two items but continue to rely on the input.

gilzow commented 1 year ago

Let's remove the default status check and only add platformsh, and instead rely on the calling workflow to pass in any additional checks.