From 8703ebd3ef8ec80dd09c55e976bae17642e182a5 Mon Sep 17 00:00:00 2001 From: AdrickTench Date: Fri, 23 Aug 2024 17:40:11 -0500 Subject: [PATCH] generate executor.json --- .github/workflows/ci.yml | 1 + scripts/generate_allure_executor.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 scripts/generate_allure_executor.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac3a086ee08..a8bffaedc70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,6 +134,7 @@ jobs: cp previous-junit.xml ./allure-results/ fi python scripts/generate_allure_environment.py ${{ github.sha }} ${{ github.ref_name }} > ./allure-results/environment.properties + python scripts/generate_allure_executor.py ${{ github.server_url }} ${{ github.repository }} ${{ github.run_id }} > ./allure-results/executor.json - name: Generate Allure Report run: | diff --git a/scripts/generate_allure_executor.py b/scripts/generate_allure_executor.py new file mode 100644 index 00000000000..73bf4e63a4b --- /dev/null +++ b/scripts/generate_allure_executor.py @@ -0,0 +1,15 @@ +import sys, json + +if __name__ == "__main__": + if len(sys.argv) != 4: + print("Usage: python scripts/generate_allure_executor.py ") + sys.exit(1) + + server_url = sys.argv[1] + repo = sys.argv[2] + run_id = sys.argv[3] + data = { 'name':'GitHub Actions', 'type':'github' } + data['buildUrl'] = '{}/{}/actions/runs/{}'.format(server_url, repo, run_id) + data['buildName'] = 'GitHub Actions Run #{}'.format(run_id) + + print(json.dumps(data)) \ No newline at end of file