-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
entrypoint.py
executable file
·27 lines (21 loc) · 888 Bytes
/
entrypoint.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
#!/usr/bin/env -S python3 -B
# NOTE: If you are using an alpine docker image
# such as pyaction-lite, the -S option above won't
# work. The above line works fine on other linux distributions
# such as debian, etc, so the above line will work fine
# if you use pyaction:4.0.0 or higher as your base docker image.
import sys
import os
if __name__ == "__main__" :
# Rename these variables to something meaningful
input1 = sys.argv[1]
input2 = sys.argv[2]
# Fake example outputs
output1 = "Hello"
output2 = "World"
# This is how you produce workflow outputs.
# Make sure corresponds to output variable names in action.yml
if "GITHUB_OUTPUT" in os.environ :
with open(os.environ["GITHUB_OUTPUT"], "a") as f :
print("{0}={1}".format("output-one", output1), file=f)
print("{0}={1}".format("output-two", output2), file=f)