The validate-this-gha-refs workflow and the actions it calls check if the @branch references in this project are properly updated when changing actions or workflows, so one can run the most up to date version of them. I'd like us to improve on this in the following ways, to instead manage the references automatically:
- The
validate-this-gha-refs workflow, if triggered by a pull request, should only run if the dont-auto-manage-gha-refs is present on the PR.
- If the
dont-auto-manage-gha-refs label is NOT present, a different workflow should update all affected references to that of the current branch in a new commit when there's a commit pushed under a PR (if any needs to be updated), by default. If the PR was approved just now (i.e. the current trigger is that), then it should update all references to the PR's target branch (i.e. revert the PR branch references). If the developer pushes new commits after the PR approval, then it should be handled as if it were a new PR. I.e., the PR branch reference should be added in a new commit again, until the next approve.
Note that the PR branch update needs a similar approach than the validate-this-gha-refs workflow and its actions, only updating those references which actually point to workflows or actions that changes. This might need multiple passes, because the first such pass may discover the outermost leaf changes, but then changing their callers will necessitates references to those updated...
I attempted this, with heavy help by Copilot, but that approach seemed futile. Maybe something worth salvaging, though: https://github.com/Lombiq/GitHub-Actions/pull/547/files/8a3a0821c96fb6686ea15f8d57ebed0e97c2e985..7e50f84337a88159ac6f6140b0ce490c1fa32290
Jira issue
The
validate-this-gha-refsworkflow and the actions it calls check if the@branchreferences in this project are properly updated when changing actions or workflows, so one can run the most up to date version of them. I'd like us to improve on this in the following ways, to instead manage the references automatically:validate-this-gha-refsworkflow, if triggered by a pull request, should only run if thedont-auto-manage-gha-refsis present on the PR.dont-auto-manage-gha-refslabel is NOT present, a different workflow should update all affected references to that of the current branch in a new commit when there's a commit pushed under a PR (if any needs to be updated), by default. If the PR was approved just now (i.e. the current trigger is that), then it should update all references to the PR's target branch (i.e. revert the PR branch references). If the developer pushes new commits after the PR approval, then it should be handled as if it were a new PR. I.e., the PR branch reference should be added in a new commit again, until the next approve.Note that the PR branch update needs a similar approach than the
validate-this-gha-refsworkflow and its actions, only updating those references which actually point to workflows or actions that changes. This might need multiple passes, because the first such pass may discover the outermost leaf changes, but then changing their callers will necessitates references to those updated...I attempted this, with heavy help by Copilot, but that approach seemed futile. Maybe something worth salvaging, though: https://github.com/Lombiq/GitHub-Actions/pull/547/files/8a3a0821c96fb6686ea15f8d57ebed0e97c2e985..7e50f84337a88159ac6f6140b0ce490c1fa32290
Jira issue