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

Fix autoblack workflow for forks #1133

Merged

Conversation

ADBond
Copy link
Contributor

@ADBond ADBond commented Mar 21, 2023

Updated the autoblack workflow to use an updated version of the checkout action. This means that the checkout is not in a 'detached head' state which necessitated the need for correcting the git ref of the PR head, which would fail if the PR is from a forked repo.

The workflow will still fail for forks if there are linting changes which need to be made (and thus will need to be performed manually by the contributor), but it should pass if the code is black-conformant, and so the failure/passing of this workflow will at least be informative.

Additionally a couple of minor changes.

Fixes #1124

@ADBond ADBond requested a review from RossKen March 23, 2023 11:35
@RossKen
Copy link
Contributor

RossKen commented Mar 23, 2023

Hey @ADBond is there a reason why you are only changing to v2 when there is a v3 available?

@ADBond
Copy link
Contributor Author

ADBond commented Mar 23, 2023

Hey @ADBond is there a reason why you are only changing to v2 when there is a v3 available?

Not particularly - just that v2 was the change that brought the fix (and initially hadn't realised v3 was available). Didn't change as atm we have a mix of v2 and v3 in the repo, and figured it would be useful at some stage to standardise some of this stuff (maybe with some reusable bits of workflows and the like). Happy to bump it up to v3 though

@RossKen
Copy link
Contributor

RossKen commented Mar 23, 2023

Ah ok, I hadn't checked the other bits of the repo. Probably better to have some consistency. Happy to go with v2 for now then we can upgrade everything in one go at a later stage

@ADBond ADBond merged commit 69cd180 into moj-analytical-services:master Mar 23, 2023
@ADBond ADBond deleted the fix-autoblack-action-for-forks branch March 23, 2023 12:34
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.

Fix autoblack workflow for fork PRs
2 participants