Skip to content

Commit f61084e

Browse files
committed
fix: Try using pathlib.Path where possible
1 parent e44439f commit f61084e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ runs:
3838
import sys, os
3939
import json
4040
41-
with open("${{ github.action_path }}bin/resources.json", "r") as f:
41+
json_file = "${{ github.action_path }}bin/resources.json"
42+
try:
43+
from pathlib import Path
44+
json_file = str(Path(json_file).resolve())
45+
except ImportError:
46+
pass
47+
48+
with open(json_file, "r") as f:
4249
json_content = json.load(f)
4350
4451
matching_versions = list(filter(lambda el: el["version"] == "${{ inputs.jython-version }}".strip(), json_content))

0 commit comments

Comments
 (0)