Skip to content

Commit

Permalink
Getting commit sha from argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Robertorosmaninho committed Sep 21, 2023
1 parent a2d5487 commit 8425ea0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ 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 @@ -68,7 +67,6 @@ 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 All @@ -84,7 +82,7 @@ jobs:
- name: 'Getting Performance Tests Results'
run: |
set -euxo pipefail
docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c 'python3 ./k-distribution/tests/profiling/post_results_to_develop.py'
docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c './k-distribution/tests/profiling/post_results_to_develop.py $(git log --format="%H" -n 1)'
- name: 'Posting Performance Tests Results'
run: |
set -euxo pipefail
Expand Down
5 changes: 4 additions & 1 deletion k-distribution/tests/profiling/post_results_to_develop.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/env python3
import json
import sys
import subprocess

# Getting commit sha from the first argument
COMMIT_SHA = sys.argv[1]
FROM_BRANCH=''
TO_BRANCH='develop'

Expand All @@ -25,7 +28,7 @@ def execute_command(command):

# 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 8425ea0

Please sign in to comment.