From 21db4d48de7bfa3b92643c9e89bae54d1044a4b1 Mon Sep 17 00:00:00 2001 From: vky Date: Sun, 23 Jan 2022 12:30:42 +0100 Subject: [PATCH] read inputs from env variables --- .github/workflows/codeql-analysis.yml | 6 +++++- fibtest.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7008aa0..ed28653 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,7 +8,7 @@ # We have attempted to detect the languages in your repository. Please check # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. -# + name: "CodeQL" on: @@ -68,3 +68,7 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 + build: + runs-on: ubuntu-latest + env: + FIB_INPUT: 10 \ No newline at end of file diff --git a/fibtest.py b/fibtest.py index 25e0b18..f280ee5 100644 --- a/fibtest.py +++ b/fibtest.py @@ -1,7 +1,9 @@ +import os + # testing Fibonacci number function def fib(n: int) -> int: return n if n < 2 else fib(n-1)+fib(n-2) def test_fibonacci(): - assert fib(10) == 54 \ No newline at end of file + assert fib(int(os.environ["FIB_INPUT"])) == 55 \ No newline at end of file