diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml index dbe7fce..dff0c97 100644 --- a/.forgejo/workflows/main.yaml +++ b/.forgejo/workflows/main.yaml @@ -16,4 +16,5 @@ jobs: - run: spcd-synchronize - uses: ./spcd/synchronize with: - num: 11 + firstarg: 2 + secondarg: 4 diff --git a/get_num_square.py b/get_num_square.py deleted file mode 100644 index b4d4cda..0000000 --- a/get_num_square.py +++ /dev/null @@ -1,11 +0,0 @@ -import os - -num = os.environ.get("INPUT_NUM") -if num: - try: - num = int(num) - except Exception: - exit("ERROR: the INPUT_NUM provided ({num}) is not an integer") - print(num**2) -else: - num = 1 diff --git a/multiply.py b/multiply.py new file mode 100644 index 0000000..da3417b --- /dev/null +++ b/multiply.py @@ -0,0 +1,8 @@ +import os + +try: + num1 = int(os.environ.get("INPUT_FIRSTARG")) + num2 = int(os.environ.get("INPUT_SECONDARG")) +except Exception: + exit(f"integer error for {num1} or {num2}") +print(num1 * num2) diff --git a/spcd/synchronize/action.yaml b/spcd/synchronize/action.yaml index b4dd26d..d195af7 100644 --- a/spcd/synchronize/action.yaml +++ b/spcd/synchronize/action.yaml @@ -4,4 +4,4 @@ inputs: runs: using: composite steps: - - run: python3 -m get_num_square + - run: python3 -m multiply