Skip to content

OUTPUT_FILE ignored in issue_metrics.py #479

@jakeatoms

Description

@jakeatoms

Describe the bug

I am using this action to run a couple different metric reports and use distinct output file names. However, there is a spot in issue_metrics.py where the file name is hardcoded to issue_metrics.md.

https://github.com/github/issue-metrics/blob/main/issue_metrics.py#L354-L357

To Reproduce

Set the environment variable to a value other than issue_metrics.md

env:
  OUTPUT_FILE: 'some_file.md'
Traceback (most recent call last):
  File "/action/workspace/issue_metrics.py", line 367, in <module>
    main()
    ~~~~^^
  File "/action/workspace/issue_metrics.py", line 354, in main
    if markdown_too_large_for_issue_body("issue_metrics.md", max_char_count):
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/action/workspace/markdown_helpers.py", line 16, in markdown_too_large_for_issue_body
    with open(file_path, "r", encoding="utf-8") as file:
         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'issue_metrics.md'

Expected behavior

The script should use the output_file variable.

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy