Change default tag in pull requests
Some checks failed
Build container image / Build and push image (pull_request) Failing after 45s
Some checks failed
Build container image / Build and push image (pull_request) Failing after 45s
This commit is contained in:
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
@@ -42,6 +42,13 @@ jobs:
|
|||||||
echo "IMAGE_REGISTRY=${IMAGE_REGISTRY,,}" >> ${GITHUB_ENV}
|
echo "IMAGE_REGISTRY=${IMAGE_REGISTRY,,}" >> ${GITHUB_ENV}
|
||||||
echo "IMAGE_NAME=${IMAGE_NAME,,}" >> ${GITHUB_ENV}
|
echo "IMAGE_NAME=${IMAGE_NAME,,}" >> ${GITHUB_ENV}
|
||||||
|
|
||||||
|
- name: Set tag to pr if pull request
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
env:
|
||||||
|
PULL_REQUEST_NUMBER: ${{ github.event.number }}
|
||||||
|
run: |
|
||||||
|
echo "DEFAULT_TAG=pr-${}" >> ${GITHUB_ENV}
|
||||||
|
|
||||||
- name: Setup Podman
|
- name: Setup Podman
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -76,10 +83,9 @@ jobs:
|
|||||||
# This generates all the tags for your image, you can add custom tags here too!
|
# This generates all the tags for your image, you can add custom tags here too!
|
||||||
# Default tags are "$DEFAULT_TAG" and "$DEFAULT_TAG.$date".
|
# Default tags are "$DEFAULT_TAG" and "$DEFAULT_TAG.$date".
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=${{ env.DEFAULT_TAG }},enable=${{ ! (github.event_name == 'pull_request') }}
|
type=raw,value=${{ env.DEFAULT_TAG }}
|
||||||
type=raw,value={{date 'YYYYMMDD'}}
|
type=raw,value={{date 'YYYYMMDD'}}
|
||||||
type=sha,enable=${{ github.event_name == 'pull_request' }}
|
type=sha,enable=${{ github.event_name == 'pull_request' }}
|
||||||
type=ref,event=pr
|
|
||||||
labels: |
|
labels: |
|
||||||
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}/refs/heads/main/README.md
|
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}/refs/heads/main/README.md
|
||||||
org.opencontainers.image.created=${{ steps.date.outputs.date }}
|
org.opencontainers.image.created=${{ steps.date.outputs.date }}
|
||||||
|
|||||||
Reference in New Issue
Block a user