From a2d548750f736ebd68ec130adbaa6579eee88833 Mon Sep 17 00:00:00 2001 From: Roberto Rosmaninho Date: Thu, 21 Sep 2023 16:01:43 -0300 Subject: [PATCH] Trying to get the commit_sha from env variables --- .github/workflows/develop.yml | 2 ++ k-distribution/tests/profiling/post_results_to_develop.py | 8 +------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index bd3773aebbd..7c740006c50 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -55,6 +55,7 @@ jobs: BENCHER_ADAPTER: json run: | set -euxo pipefail + COMMIT_SHA=$(git log --format="%H" -n 1) docker run --name k-posting-profiling-tests-${GITHUB_SHA} \ --rm -it --detach \ -e BENCHER_API_TOKEN=$BENCHER_API_TOKEN \ @@ -67,6 +68,7 @@ jobs: -e GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME \ -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \ -e GITHUB_REF=$GITHUB_REF \ + -e GITHUB_SHA=$GITHUB_SHA \ --workdir /opt/workspace \ ${BASE_OS}:${BASE_DISTRO} - name: 'Copy K Framework' diff --git a/k-distribution/tests/profiling/post_results_to_develop.py b/k-distribution/tests/profiling/post_results_to_develop.py index 5f5ae17bcb1..09b74549e8a 100755 --- a/k-distribution/tests/profiling/post_results_to_develop.py +++ b/k-distribution/tests/profiling/post_results_to_develop.py @@ -2,7 +2,6 @@ import json import subprocess -COMMIT_SHA='' FROM_BRANCH='' TO_BRANCH='develop' @@ -24,14 +23,9 @@ def execute_command(command): return result.stdout -# git command to get the last commit in develop -#commit_command = [ 'git', 'log', '--format=\"%H\"', '-n', '1' ] -COMMIT_SHA = "4704126b2a6e014d8787894a4d9f5efedbbcb204" -#execute_command(commit_command).strip('\"').strip('\"\n') - # curl command to get the branch name of last commit in develop API_URL = 'https://api.github.com/repos/runtimeverification/k/commits/' \ - + COMMIT_SHA + '/pulls' + + '${COMMIT_SHA}/pulls' branch_command = ['curl', '-L', '-H', 'Accept:', 'application/vnd.github+json', '-H', '\"Authorization', 'Bearer', '${GITHUB_TOKEN}\"', '-H', '\"X-GitHub-Api-Version:', '2022-11-28\"', API_URL]