Files
mustafa/.github/workflows/release-please.yml
T
leanderandClaude Opus 5.5 0e6718d751 fix(ci): keep the checkout token out of the published image
actions/checkout@v5 stored the job's GitHub token in .git/config, and
the image copies .git, so published images contained it. Use checkout
v7 with persist-credentials: false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 03:53:06 +01:00

65 lines
1.8 KiB
YAML

name: Release Please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
version: ${{ steps.release.outputs.version }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
# Releases made by release-please don't trigger other workflows (GitHub ignores events
# created with GITHUB_TOKEN), so the image is published from here instead.
publish-image:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/uio-gaming/mustafa
tags: |
type=semver,pattern={{version}},value=${{ needs.release-please.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release-please.outputs.version }}
type=semver,pattern={{major}},value=${{ needs.release-please.outputs.version }}
type=raw,value=latest
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max