Fix parsing github commit status to container

There was an instance of the git commit message not being passed
correctly to the build, thus returning nil on the faas-cli version
command.

Tested on a failing commit by amending the commit (keeping message) and
getting CI to run green

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
This commit is contained in:
Alistair Hey 2020-12-11 21:21:00 +00:00 committed by Alex Ellis
parent 272ae94b50
commit a2bdc94f00
2 changed files with 12 additions and 3 deletions

View File

@ -35,6 +35,9 @@ jobs:
- name: Get Repo Owner
id: get_repo_owner
run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
- name: Get Commit Message
id: get_commit_message
run: echo ::set-output name=commit_message::$(git log -1 --pretty=%B 2>&1 | head -n 1)
- name: Build Gateway
uses: docker/build-push-action@v2
with:
@ -46,7 +49,7 @@ jobs:
build-args: |
VERSION=${{ steps.get_tag.outputs.TAG }}
GIT_COMMIT=${{ github.sha }}
GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }}
GIT_COMMIT_MESSAGE=${{ steps.get_commit_message.outputs.commit_message }}
tags: |
ghcr.io/openfaas/gateway:latest-dev
- name: Run CI
@ -71,6 +74,9 @@ jobs:
- name: Get Repo Owner
id: get_repo_owner
run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
- name: Get Commit Message
id: get_commit_message
run: echo ::set-output name=commit_message::$(git log -1 --pretty=%B 2>&1 | head -n 1)
- name: Build ${{ matrix.svc }}
uses: docker/build-push-action@v2
with:
@ -81,7 +87,7 @@ jobs:
build-args: |
VERSION=${{ steps.get_tag.outputs.TAG }}
GIT_COMMIT=${{ github.sha }}
GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }}
GIT_COMMIT_MESSAGE=${{ steps.get_commit_message.outputs.commit_message }}
tags: |
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ steps.get_tag.outputs.TAG }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ github.sha }}

View File

@ -32,6 +32,9 @@ jobs:
- name: Get Repo Owner
id: get_repo_owner
run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
- name: Get Commit Message
id: get_commit_message
run: echo ::set-output name=commit_message::$(git log -1 --pretty=%B 2>&1 | head -n 1)
- name: Publish ${{ matrix.svc }}
uses: docker/build-push-action@v2
with:
@ -42,7 +45,7 @@ jobs:
build-args: |
VERSION=${{ steps.get_tag.outputs.TAG }}
GIT_COMMIT=${{ github.sha }}
GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }}
GIT_COMMIT_MESSAGE="${{ steps.get_commit_message.outputs.commit_message }}"
tags: |
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ steps.get_tag.outputs.TAG }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ github.sha }}