Replace variables with gitlog
This commit is contained in:
@@ -34,6 +34,12 @@ jobs:
|
|||||||
id: date
|
id: date
|
||||||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
||||||
|
|
||||||
|
- name: Get commit information
|
||||||
|
id: gitinfo
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=sha::$(git log -1 --format="%H")"
|
||||||
|
echo "::set-output name=message::$(git log -1 --format="%s")"
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
|
||||||
@@ -59,6 +65,6 @@ jobs:
|
|||||||
cache-to: "mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=${{ vars.DOCKER_IMAGE }}:cache"
|
cache-to: "mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=${{ vars.DOCKER_IMAGE }}:cache"
|
||||||
cache-from: "mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=${{ vars.DOCKER_IMAGE }}:cache"
|
cache-from: "mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=${{ vars.DOCKER_IMAGE }}:cache"
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.revision=${{ env.GITHUB_COMMIT_SHA }}
|
org.opencontainers.image.revision=${{ steps.gitinfo.outputs.sha }}
|
||||||
org.opencontainers.image.source=${{ env.GITHUB_REPOSITORY }}
|
org.opencontainers.image.commit_message=${{ steps.gitinfo.outputs.message }}
|
||||||
org.opencontainers.image.created=${{ steps.date.outputs.date }}
|
org.opencontainers.image.created=${{ steps.date.outputs.date }}
|
||||||
|
|||||||
Reference in New Issue
Block a user