-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
executable file
·31 lines (25 loc) · 1003 Bytes
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
import os
import subprocess
import yaml
def main():
with open("action.yml", encoding="utf-8") as action_file:
action = yaml.load(action_file, Loader=yaml.SafeLoader)
subprocess.run(
["./install"],
env={
"PATH": os.environ["PATH"],
"HOME": os.environ["HOME"],
"GITHUB_ENV": os.environ["GITHUB_ENV"],
"PATTERNS": os.environ["PATTERNS"],
"CI_GPG_PRIVATE_KEY": os.environ["CI_GPG_PRIVATE_KEY"],
"GITHUB_GOPASS_CI_TOKEN": os.environ["GOPASS_CI_GITHUB_TOKEN"],
"GOPASS_VERSION": action["inputs"]["gopass_version"]["default"].lstrip("v"),
"SUMMON_VERSION": action["inputs"]["summon_version"]["default"].lstrip("v"),
"GPG_FINGERPRINT": action["inputs"]["gpg-fingerprint"]["default"],
"GITHUB_REPOSITORY": action["inputs"]["github-repository"]["default"],
},
check=True,
)
if __name__ == "__main__":
main()