Skip to content

Commit

Permalink
Trying to get the commit_sha from env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Robertorosmaninho committed Sep 21, 2023
1 parent 92ebdcc commit a2d5487
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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'
Expand Down
8 changes: 1 addition & 7 deletions k-distribution/tests/profiling/post_results_to_develop.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json
import subprocess

COMMIT_SHA=''
FROM_BRANCH=''
TO_BRANCH='develop'

Expand All @@ -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]
Expand Down

0 comments on commit a2d5487

Please sign in to comment.