Skip to content

Commit

Permalink
refactor: remove pr_url variable in favor of inline PR URL
Browse files Browse the repository at this point in the history
  • Loading branch information
BilalQamar95 committed Jan 24, 2025
1 parent aa7864e commit 412ba36
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions edx_repo_tools/pull_request_creator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,16 +617,14 @@ def _create_new_pull_request(self):
pr.number,
)
if self.output_pr_url_for_github_action:
pr_url = f"https://github.com/{self.repository.full_name}/pull/{pr.number}"

# need to append to the special file that GitHub actions exposes
# as using print here won't set the output, it simply logs the message
github_output_path = os.environ.get("GITHUB_OUTPUT")
if not github_output_path:
logger.warning("GITHUB_OUTPUT not set, failed to write action output.")
else:
with open(github_output_path, "a", encoding="utf-8") as out_file:
out_file.write(f"generated_pr={pr_url}\n")
out_file.write(f"generated_pr=https://github.com/{self.repository.full_name}/pull/{pr.number}\n")

def delete_old_pull_requests(self):
logger.info("Checking if there's any old pull requests to delete")
Expand Down

0 comments on commit 412ba36

Please sign in to comment.