Skip to content

Commit e175404

Browse files
Merge pull request #111 from opendevstack/experimental
Solves GitHub pipelines actions problems.
2 parents 42d9f95 + cd5734a commit e175404

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/continuous-integration-workflow.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,26 @@ jobs:
3838
- name: copy created artifacts into docker context
3939
run: |
4040
cp build/libs/*-all.jar ./docker/app.jar
41+
- name: Show GitHub context (for debugging purposes)
42+
env:
43+
GITHUB_CONTEXT: ${{ toJson(github) }}
44+
run: echo "$GITHUB_CONTEXT"
4145
- name: Build docker image
4246
if: success()
4347
run: |
44-
COMMIT_AUTHOR=$(git --no-pager show -s --format='%an (%ae)' $GITHUB_SHA)
45-
COMMIT_MESSAGE=$(git log -1 --pretty=%B $GITHUB_SHA)
46-
COMMIT_TIME=$(git show -s --format=%ci $GITHUB_SHA)
48+
echo "GITHUB_SHA (invalid): $GITHUB_SHA "
49+
COMMIT_HEAD_SHA="${{ github.event.pull_request.head.sha }}"
50+
echo "COMMIT_HEAD_SHA: $COMMIT_HEAD_SHA"
51+
COMMIT_AUTHOR=$(git --no-pager show -s --format='%an (%ae)' $COMMIT_HEAD_SHA)
52+
COMMIT_MESSAGE=$(git log -1 --pretty=%B $COMMIT_HEAD_SHA)
53+
COMMIT_TIME=$(git show -s --format=%ci $COMMIT_HEAD_SHA)
4754
BUILD_TIME=$(date -u "+%Y-%m-%d %H:%M:%S %z")
4855
docker build \
4956
--label "ods.build.job.url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
5057
--label "ods.build.source.repo.ref=$GITHUB_REF" \
5158
--label "ods.build.source.repo.commit.author=$COMMIT_AUTHOR" \
5259
--label "ods.build.source.repo.commit.msg=$COMMIT_MESSAGE" \
53-
--label "ods.build.source.repo.commit.sha=$GITHUB_SHA" \
60+
--label "ods.build.source.repo.commit.sha=$COMMIT_HEAD_SHA" \
5461
--label "ods.build.source.repo.commit.timestamp=$COMMIT_TIME" \
5562
--label "ods.build.source.repo.url=https://github.com/$GITHUB_REPOSITORY.git" \
5663
--label "ods.build.timestamp=$BUILD_TIME" \

0 commit comments

Comments
 (0)