Skip to content

fix(deps): update module github.com/traefik/traefik/v2 to v2.11.41 [security] #108

fix(deps): update module github.com/traefik/traefik/v2 to v2.11.41 [security]

fix(deps): update module github.com/traefik/traefik/v2 to v2.11.41 [security] #108

name: Push PR Image on Label
# Use pull_request_target to run in base repo context (has secrets access)
# This is safe because we only run after maintainer adds the label (implicit code review)
on:
pull_request_target:
branches:
- master
types: [ labeled ]
env:
REGISTRY: ghcr.io
permissions:
contents: read
packages: write
jobs:
push-image:
runs-on: ubuntu-latest
name: Push PR Image
if: ${{ github.event.label.name == 'build-push-image' }}
steps:
- name: Remove the build label
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: build-push-image
- name: Check out code
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Generate Tag
id: generate_tag
run: |
sha=${{ github.event.pull_request.head.sha }}
tag="SNAPSHOT-PR-${{ github.event.pull_request.number }}-${sha:0:8}"
echo "GIT_TAG=${tag}" >> $GITHUB_OUTPUT
- name: Generate build metadata
id: meta
run: |
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Generate image repository path
run: |
echo GHCR_IMAGE_REPOSITORY=${{ env.REGISTRY }}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Login to ghcr registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: stakater-user
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile
pull: true
push: true
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.meta.outputs.created }}
org.opencontainers.image.revision=${{ github.event.pull_request.head.sha }}