20 lines
424 B
Python
20 lines
424 B
Python
import hashlib
|
|
import json
|
|
|
|
|
|
def hash_action(action):
|
|
raw = json.dumps(action, sort_keys=True).encode()
|
|
return hashlib.sha256(raw).hexdigest()
|
|
|
|
|
|
def create_action(name, inputs, command, outputs,
|
|
env=None, runtime="host"):
|
|
return {
|
|
"name": name,
|
|
"inputs": inputs,
|
|
"command": command,
|
|
"outputs": outputs,
|
|
"env": env or {},
|
|
"runtime": runtime
|
|
}
|