From 79a02a08f119930caf5e2d1f37cc6b0951876061 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 14 Oct 2024 13:40:03 +0200 Subject: [PATCH] multiply --- .forgejo/workflows/main.yaml | 3 ++- get_num_square.py | 11 ----------- multiply.py | 8 ++++++++ spcd/synchronize/action.yaml | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 get_num_square.py create mode 100644 multiply.py 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