Skip to content

Commit

Permalink
change(action-log): specifics (json response, JQL query) print only i…
Browse files Browse the repository at this point in the history
…n debug mode
  • Loading branch information
tomassebestik committed Sep 6, 2024
1 parent 8c43b5b commit 0786829
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sync_jira_actions/sync_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ def _find_jira_issue(jira, gh_issue, make_new=False, retries=5):
"""
url = gh_issue['html_url']
jql_query = f'issue in issuesWithRemoteLinksByGlobalId("{url}") order by updated desc'
print(f'JQL query: {jql_query}')
if os.environ.get('ACTIONS_RUNNER_DEBUG') == 'true':
print(f'JQL query: {jql_query}') # Print the JQL query only in debug mode
res = jira.search_issues(jql_query)
if not res:
print(f"WARNING: No JIRA issues have a remote link with globalID '{url}'")
Expand Down
3 changes: 2 additions & 1 deletion sync_jira_actions/sync_to_jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def main():
# The path of the file with the complete webhook event payload. For example, /github/workflow/event.json.
with open(os.environ['GITHUB_EVENT_PATH'], 'r', encoding='utf-8') as file:
event = json.load(file)
print(json.dumps(event, indent=4))
if os.environ.get('ACTIONS_RUNNER_DEBUG') == 'true':
print(json.dumps(event, indent=4))

event_name = os.environ['GITHUB_EVENT_NAME']

Expand Down

0 comments on commit 0786829

Please sign in to comment.