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

Correct getting affected projects in Nx #2

Merged
merged 6 commits into from
Sep 3, 2024
Merged

Conversation

pv72895
Copy link
Collaborator

@pv72895 pv72895 commented Aug 30, 2024

Copy link

@matt-fff matt-fff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I don't see any issues

@@ -35,6 +35,8 @@ def fetch_remote_git_history(ref):
print("No merge instance branch found. Exiting.")
sys.exit(1)

write_to_github_output(f"merge_instance_branch={merge_instance_branch}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just logging, essentially?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, which is called during the prerequisite step of this workflow, is outputting to github's output, which gets passed around between all of the remaining steps in the flow. That's why we switch to passing in steps.prerequisites.outputs.merge_instance_branch for the merge branch for the other steps (link). We do this because providing the merge branch to us is optional - we use the repo's default branch if it isn't provided, and we make the prerequisite step figure that out for us (link)


affected_json = json.loads(run_command(f"cat {affected_json_out}", return_output=True))
affected_list_out = f"./{merge_instance_branch_head_sha}_{pr_branch_head_sha}.txt"
nx_show_command_base = f"npx nx show projects --affected --base={merge_instance_branch_head_sha} --head={pr_branch_head_sha}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this out locally and it seems to check out.

@pv72895 pv72895 merged commit 95acce4 into main Sep 3, 2024
@pv72895 pv72895 deleted the phil/correct-nx-action branch September 3, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants