jwsi / secret-parser

Replaces GitHub Actions secrets referenced in files with their raw values
MIT License
25 stars 9 forks source link

Assumes incorrect root path #2

Open palok opened 1 year ago

palok commented 1 year ago

Using this in May 2023 with ubuntu-latest fails with the following error message (redacted actual file names)

Attempting to parse file: /home/runner/work/my-project/my-project/kubernetes/config/secrets/my-secrets.yaml
Traceback (most recent call last):
  File "/main.py", line 25, in <module>
    parser(args.filename, args.secret_name, args.secret_value)
  File "/main.py", line 9, in parser
    with open('/github/workspace/' + filename, 'r') as fd:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/github/workspace//home/runner/work/my-project/my-project/kubernetes/config/secrets/my-secrets.yaml'

There is no /github/workspace/ directory in an ubuntu-latest runner.

jwsi commented 1 year ago

Interesting, I'll attempt to reproduce then work on a fix ASAP.