ci: remove PAT from release workflows, use workflow_call instead

Tags pushed with GITHUB_TOKEN don't trigger other workflows (GitHub's
anti-recursion protection), which is why a PAT was needed. Instead,
chain release and docker workflows directly via workflow_call from
bump-version, eliminating the need for a personal access token.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-04-07 22:10:25 +02:00
co-authored by Claude Opus 4.6
parent 3af670ace5
commit 1e380caade
3 changed files with 67 additions and 12 deletions
+23 -9
View File
@@ -4,6 +4,12 @@ on:
push:
tags:
- "v*"
workflow_call:
inputs:
tag:
description: 'The tag to release (e.g. v0.70.2)'
required: true
type: string
jobs:
build-and-push:
@@ -12,26 +18,34 @@ jobs:
contents: read
packages: write
steps:
- name: Resolve tag
id: resolve
run: |
if [ -n "${{ inputs.tag }}" ]; then
TAG="${{ inputs.tag }}"
else
TAG="${GITHUB_REF#refs/tags/}"
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ steps.resolve.outputs.tag }}
- name: Docker meta
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/cbcoutinho/nextcloud-mcp-server
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern={{version}},value=${{ steps.resolve.outputs.tag }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.resolve.outputs.tag }}
type=semver,pattern={{major}},value=${{ steps.resolve.outputs.tag }}
type=sha
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0