mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-22 22:06:43 +00:00
Fix SHA when workflow run manually
This commit is contained in:
parent
eb4306a705
commit
216450e77f
4
main.py
4
main.py
@ -646,8 +646,12 @@ class TodoParser(object):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Create a basic client for communicating with GitHub, automatically initialised with environment variables.
|
# Create a basic client for communicating with GitHub, automatically initialised with environment variables.
|
||||||
client = GitHubClient()
|
client = GitHubClient()
|
||||||
|
# Check to see if the workflow has been run manually.
|
||||||
|
# If so, adjust the client SHA and diff URL to use the manually supplied inputs.
|
||||||
manual_commit_ref = os.getenv('MANUAL_COMMIT_REF')
|
manual_commit_ref = os.getenv('MANUAL_COMMIT_REF')
|
||||||
manual_base_ref = os.getenv('MANUAL_BASE_REF')
|
manual_base_ref = os.getenv('MANUAL_BASE_REF')
|
||||||
|
if manual_commit_ref:
|
||||||
|
client.sha = manual_commit_ref
|
||||||
if manual_commit_ref and manual_base_ref:
|
if manual_commit_ref and manual_base_ref:
|
||||||
print(f'Manually comparing {manual_base_ref}...{manual_commit_ref}')
|
print(f'Manually comparing {manual_base_ref}...{manual_commit_ref}')
|
||||||
client.diff_url = f'{client.repos_url}{client.repo}/compare/{manual_base_ref}...{manual_commit_ref}'
|
client.diff_url = f'{client.repos_url}{client.repo}/compare/{manual_base_ref}...{manual_commit_ref}'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user