fix: replace GitHub App token with GITEA_TOKEN in workflows (PRI-1533) (#190)

This commit is contained in:
2026-05-14 18:42:13 +00:00
parent 4a3c3d790e
commit c73ab6079b
4 changed files with 132 additions and 170 deletions
+3 -14
View File
@@ -12,22 +12,11 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
continue-on-error: true
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: privilegedescalation
- name: Run CI/CD health check - name: Run CI/CD health check
env: env:
GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: | run: |
if [ "${{ steps.app-token.outcome }}" = "success" ]; then if [ -z "$GITEA_TOKEN" ]; then
echo "Using GitHub App token for cross-repo access" echo "::warning::GITEA_TOKEN not configured — health check may have limited data."
else
echo "::warning::RELEASE_APP_ID not configured — using GITHUB_TOKEN. Cross-repo workflow run data will be unavailable. Configure RELEASE_APP_ID org secret to enable full health check."
fi fi
./.github/scripts/ci-health-check.sh ./.github/scripts/ci-health-check.sh
+117 -140
View File
@@ -18,11 +18,8 @@ on:
type: string type: string
default: '' default: ''
secrets: secrets:
RELEASE_APP_ID: GITEA_RELEASE_TOKEN:
description: 'GitHub App ID for creating PRs (org blocks GITHUB_TOKEN from creating PRs)' description: 'Gitea token with write access to repos (replaces GitHub App token flow)'
required: true
RELEASE_APP_PRIVATE_KEY:
description: 'GitHub App private key (PEM format)'
required: true required: true
permissions: permissions:
@@ -39,13 +36,13 @@ jobs:
outputs: outputs:
ready: ${{ steps.check.outputs.ready }} ready: ${{ steps.check.outputs.ready }}
steps: steps:
- name: Verify RELEASE_APP_ID is configured - name: Verify GITEA_RELEASE_TOKEN is configured
id: check id: check
env: env:
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }} GITEA_RELEASE_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: | run: |
if [ -z "$RELEASE_APP_ID" ]; then if [ -z "$GITEA_RELEASE_TOKEN" ]; then
echo "::notice::RELEASE_APP_ID org secret is not configured (see PRI-380). Release skipped — no artifacts will be created." echo "::notice::GITEA_RELEASE_TOKEN org secret is not configured (see PRI-1533). Release skipped — no artifacts will be created."
echo "ready=false" >> $GITHUB_OUTPUT echo "ready=false" >> $GITHUB_OUTPUT
else else
echo "ready=true" >> $GITHUB_OUTPUT echo "ready=true" >> $GITHUB_OUTPUT
@@ -65,28 +62,24 @@ jobs:
outputs: outputs:
has_write: ${{ steps.check.outputs.has_write }} has_write: ${{ steps.check.outputs.has_write }}
steps: steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- name: Check write permissions via API - name: Check write permissions via API
id: check id: check
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
REPO: ${{ github.repository }}
run: | run: |
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \ HTTP_CODE=$(curl -sf -o /dev/null -w "%{http_code}" \
-X POST \ -X POST \
-H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" \ -H "Authorization: token ${GITEA_TOKEN}" \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/json" \
"https://api.github.com/repos/${{ github.repository }}/git/refs" \ "https://git.farh.net/api/v1/repos/${REPO}/git/refs" \
-d '{"ref":"refs/heads/_release_check","sha":"${{ github.sha }}"}') -d '{"ref":"refs/heads/_release_check","sha":"${{ github.sha }}"}')
if [ "$HTTP_CODE" = "201" ]; then if [ "$HTTP_CODE" = "201" ]; then
echo "::notice::Token has write permission — cleaning up test ref." echo "::notice::Token has write permission — cleaning up test ref."
curl -s -o /dev/null -w "%{http_code}" \ curl -sf -o /dev/null -w "%{http_code}" \
-X DELETE \ -X DELETE \
-H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" \ -H "Authorization: token ${GITEA_TOKEN}" \
"https://api.github.com/repos/${{ github.repository }}/git/refs/heads/_release_check" "https://git.farh.net/api/v1/repos/${REPO}/git/refs/heads/_release_check"
echo "has_write=true" >> $GITHUB_OUTPUT echo "has_write=true" >> $GITHUB_OUTPUT
elif [ "$HTTP_CODE" = "403" ]; then elif [ "$HTTP_CODE" = "403" ]; then
echo "::error::Token lacks write permission. Release cannot push tags or branches." echo "::error::Token lacks write permission. Release cannot push tags or branches."
@@ -107,10 +100,13 @@ jobs:
steps: steps:
- name: Check if tag already exists - name: Check if tag already exists
id: check id: check
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
REPO: ${{ github.repository }}
run: | run: |
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \ HTTP_CODE=$(curl -sf -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer ${{ github.token }}" \ -H "Authorization: token ${GITEA_TOKEN}" \
"https://api.github.com/repos/${{ github.repository }}/git/refs/tags/v${{ inputs.version }}") "https://git.farh.net/api/v1/repos/${REPO}/git/refs/tags/v${{ inputs.version }}")
if [ "$HTTP_CODE" = "200" ]; then if [ "$HTTP_CODE" = "200" ]; then
echo "::notice::Tag v${{ inputs.version }} already exists. Release skipped (not an error)." echo "::notice::Tag v${{ inputs.version }} already exists. Release skipped (not an error)."
echo "skip=true" >> $GITHUB_OUTPUT echo "skip=true" >> $GITHUB_OUTPUT
@@ -143,10 +139,6 @@ jobs:
if [ -f "pnpm-lock.yaml" ]; then if [ -f "pnpm-lock.yaml" ]; then
echo "manager=pnpm" >> $GITHUB_OUTPUT echo "manager=pnpm" >> $GITHUB_OUTPUT
echo "lockfile=pnpm-lock.yaml" >> $GITHUB_OUTPUT echo "lockfile=pnpm-lock.yaml" >> $GITHUB_OUTPUT
# Check for packageManager field in package.json (Corepack pinning).
# pnpm/action-setup@v5 errors when packageManager is absent and no version
# is specified, so use Corepack for repos that have the field pinned and
# fall back to pnpm/action-setup with version: latest for repos that don't.
PM=$(python3 -c "import json,sys; d=json.load(open('package.json')); print('true' if d.get('packageManager','').startswith('pnpm@') else 'false')" 2>/dev/null || echo "false") PM=$(python3 -c "import json,sys; d=json.load(open('package.json')); print('true' if d.get('packageManager','').startswith('pnpm@') else 'false')" 2>/dev/null || echo "false")
echo "has_package_manager=$PM" >> $GITHUB_OUTPUT echo "has_package_manager=$PM" >> $GITHUB_OUTPUT
else else
@@ -159,11 +151,9 @@ jobs:
uses: actions/setup-node@v6 uses: actions/setup-node@v6
with: with:
node-version: ${{ inputs.node-version }} node-version: ${{ inputs.node-version }}
# Only enable built-in npm caching here; pnpm caching is handled below
# after pnpm is installed (corepack is not available before setup-node).
cache: ${{ steps.pkg-manager.outputs.manager == 'npm' && 'npm' || '' }} cache: ${{ steps.pkg-manager.outputs.manager == 'npm' && 'npm' || '' }}
- name: Setup pnpm (via Corepack, reads version from packageManager field) - name: Setup pnpm (via Corepack)
if: steps.pkg-manager.outputs.manager == 'pnpm' && steps.pkg-manager.outputs.has_package_manager == 'true' if: steps.pkg-manager.outputs.manager == 'pnpm' && steps.pkg-manager.outputs.has_package_manager == 'true'
run: | run: |
npm install -g corepack npm install -g corepack
@@ -192,10 +182,13 @@ jobs:
${{ runner.os }}-pnpm- ${{ runner.os }}-pnpm-
- name: Configure Git - name: Configure Git
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: | run: |
git config --global user.name "github-actions[bot]" git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global --add safe.directory "$GITHUB_WORKSPACE" git config --global --add safe.directory "$GITHUB_WORKSPACE"
git remote set-url origin "https://x-access-token:${GITEA_TOKEN}@git.farh.net/${{ github.repository }}.git"
- name: Update version in package.json - name: Update version in package.json
run: | run: |
@@ -206,6 +199,8 @@ jobs:
fi fi
- name: Update artifacthub-pkg.yml - name: Update artifacthub-pkg.yml
env:
REPO: ${{ github.repository }}
run: | run: |
VERSION="${{ inputs.version }}" VERSION="${{ inputs.version }}"
if [ -f artifacthub-pkg.yml ]; then if [ -f artifacthub-pkg.yml ]; then
@@ -213,14 +208,18 @@ jobs:
else else
PKG_NAME=$(jq -r .name package.json | sed 's|^@[^/]*/||') PKG_NAME=$(jq -r .name package.json | sed 's|^@[^/]*/||')
fi fi
RELEASE_URL="https://github.com/${{ github.repository }}/releases/download/v${VERSION}/${PKG_NAME}-${VERSION}.tar.gz" RELEASE_URL="https://git.farh.net/${REPO}/releases/download/v${VERSION}/${PKG_NAME}-${VERSION}.tar.gz"
sed -i "s/^version:.*/version: \"${VERSION}\"/" artifacthub-pkg.yml sed -i "s/^version:.*/version: \"${VERSION}\"/" artifacthub-pkg.yml
sed -i "s|headlamp/plugin/archive-url:.*|headlamp/plugin/archive-url: \"${RELEASE_URL}\"|" artifacthub-pkg.yml sed -i "s|headlamp/plugin/archive-url:.*|headlamp/plugin/archive-url: \"${RELEASE_URL}\"|" artifacthub-pkg.yml
- name: Update appVersion from upstream release - name: Update appVersion from upstream release
if: inputs.upstream-repo != '' if: inputs.upstream-repo != ''
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: | run: |
APP_VERSION=$(curl -sf "https://api.github.com/repos/${{ inputs.upstream-repo }}/releases/latest" | jq -r '.tag_name | ltrimstr("v")') APP_VERSION=$(curl -sf \
-H "Authorization: token ${GITEA_TOKEN}" \
"https://git.farh.net/api/v1/repos/${{ inputs.upstream-repo }}/releases/latest" | jq -r '.tag_name | ltrimstr("v")')
if [ -z "$APP_VERSION" ] || [ "$APP_VERSION" = "null" ]; then if [ -z "$APP_VERSION" ] || [ "$APP_VERSION" = "null" ]; then
echo "::warning::Could not fetch latest upstream release, skipping appVersion update" echo "::warning::Could not fetch latest upstream release, skipping appVersion update"
else else
@@ -259,8 +258,6 @@ jobs:
- name: Prepare release tarball - name: Prepare release tarball
run: | run: |
VERSION="${{ inputs.version }}" VERSION="${{ inputs.version }}"
# headlamp-plugin strips the @org/ prefix when naming tarballs.
# e.g. @privilegedescalation/headlamp-argocd-plugin -> headlamp-argocd-plugin
if [ -f artifacthub-pkg.yml ]; then if [ -f artifacthub-pkg.yml ]; then
PKG_NAME=$(grep '^name:' artifacthub-pkg.yml | cut -d: -f2 | tr -d ' "') PKG_NAME=$(grep '^name:' artifacthub-pkg.yml | cut -d: -f2 | tr -d ' "')
else else
@@ -292,13 +289,11 @@ jobs:
sed -i "s|headlamp/plugin/archive-checksum:.*|headlamp/plugin/archive-checksum: sha256:${CHECKSUM}|" artifacthub-pkg.yml sed -i "s|headlamp/plugin/archive-checksum:.*|headlamp/plugin/archive-checksum: sha256:${CHECKSUM}|" artifacthub-pkg.yml
- name: Commit and tag - name: Commit and tag
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: | run: |
VERSION="${{ inputs.version }}" VERSION="${{ inputs.version }}"
BRANCH="release/v${VERSION}" BRANCH="release/v${VERSION}"
# If the release branch already exists (e.g. from a failed prior run),
# delete it so the re-trigger can proceed cleanly. The check-tag job
# above already skips when the tag exists, so we only reach here when
# the tag does NOT exist yet — safe to remove a stale branch.
if git ls-remote --exit-code origin "refs/heads/$BRANCH" 2>/dev/null; then if git ls-remote --exit-code origin "refs/heads/$BRANCH" 2>/dev/null; then
echo "::notice::Branch $BRANCH already exists — deleting for clean re-trigger." echo "::notice::Branch $BRANCH already exists — deleting for clean re-trigger."
git push origin --delete "$BRANCH" git push origin --delete "$BRANCH"
@@ -310,131 +305,113 @@ jobs:
git push origin "$BRANCH" git push origin "$BRANCH"
git push origin "refs/tags/v${VERSION}" git push origin "refs/tags/v${VERSION}"
- name: Create GitHub Release - name: Create Gitea Release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ inputs.version }}"
files: ${{ env.TARBALL }}
fail_on_unmatched_files: false
generate_release_notes: true
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
REPO: ${{ github.repository }}
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- name: Install GitHub CLI
run: | run: |
if ! command -v gh &>/dev/null; then VERSION="${{ inputs.version }}"
GH_VERSION="2.74.0" TARBALL="${{ env.TARBALL }}"
curl -fsSL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_amd64.tar.gz" -o /tmp/gh.tar.gz RESPONSE=$(curl -sf -X POST \
tar -xzf /tmp/gh.tar.gz -C /tmp -H "Authorization: token ${GITEA_TOKEN}" \
mkdir -p "$HOME/.local/bin" -H "Content-Type: application/json" \
mv "/tmp/gh_${GH_VERSION}_linux_amd64/bin/gh" "$HOME/.local/bin/gh" "https://git.farh.net/api/v1/repos/${REPO}/releases" \
rm -rf /tmp/gh.tar.gz "/tmp/gh_${GH_VERSION}_linux_amd64" -d "{
echo "$HOME/.local/bin" >> "$GITHUB_PATH" \"tag_name\": \"v${VERSION}\",
"$HOME/.local/bin/gh" --version \"name\": \"Release v${VERSION}\",
\"draft\": false,
\"prerelease\": false
}")
if [ -z "$RESPONSE" ]; then
echo "::warning::Release creation returned empty response (may already exist)"
else
echo "::notice::Release v${VERSION} created successfully"
fi
UPLOAD_URL=$(echo "$RESPONSE" | jq -r '.upload_url' 2>/dev/null || echo "")
if [ -n "$UPLOAD_URL" ] && [ "$UPLOAD_URL" != "null" ]; then
UPLOAD_URL="${UPLOAD_URL%%\{*}"
curl -sf -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/octet-stream" \
"${UPLOAD_URL}?name=${TARBALL}" \
--data-binary "@${TARBALL}"
echo "::notice::Tarball uploaded successfully"
fi fi
- name: Create PR for version bump - name: Create PR for version bump
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
REPO: ${{ github.repository }}
run: | run: |
set -o pipefail set -o pipefail
VERSION="${{ inputs.version }}" VERSION="${{ inputs.version }}"
BODY=$(printf "Automated version bump and checksum update for v%s.\n\ncc @cpfarhood" "${VERSION}") BODY=$(printf "Automated version bump and checksum update for v%s.\n\ncc @cpfarhood" "${VERSION}")
# Create PR only if an OPEN one doesn't already exist. RESPONSE=$(curl -sf -X POST \
# Note: gh pr view also finds MERGED PRs; we must check for open ones explicitly -H "Authorization: token ${GITEA_TOKEN}" \
# so that a re-trigger after a stale-branch delete creates a fresh PR. -H "Content-Type: application/json" \
OPEN_PR=$(gh pr list --base main --head "release/v${VERSION}" --state open --json number --jq '.[0].number' 2>/dev/null) "https://git.farh.net/api/v1/repos/${REPO}/pulls" \
if [ -z "$OPEN_PR" ]; then -d "{
gh pr create \ \"title\": \"release: v${VERSION}\",
--title "release: v${VERSION}" \ \"body\": \"$BODY\",
--body "$BODY" \ \"base\": \"main\",
--base main \ \"head\": \"release/v${VERSION}\"
--head "release/v${VERSION}" }")
# Pull the number again to handle both create and pre-existing cases PR_NUMBER=$(echo "$RESPONSE" | jq -r '.number' 2>/dev/null || echo "")
OPEN_PR=$(gh pr list --base main --head "release/v${VERSION}" --state open --json number --jq '.[0].number' 2>/dev/null) if [ -z "$PR_NUMBER" ] || [ "$PR_NUMBER" = "null" ]; then
else EXISTING=$(curl -sf \
echo "::notice::Open PR #${OPEN_PR} for release/v${VERSION} already exists — skipping creation." -H "Authorization: token ${GITEA_TOKEN}" \
"https://git.farh.net/api/v1/repos/${REPO}/pulls?state=open&base=main&head=release/v${VERSION}" \
| jq -r '.[0].number' 2>/dev/null || echo "")
if [ -n "$EXISTING" ] && [ "$EXISTING" != "null" ]; then
PR_NUMBER="$EXISTING"
echo "::notice::Open PR #${PR_NUMBER} for release/v${VERSION} already exists — skipping creation."
else
echo "::error::Could not determine PR number for release/v${VERSION}."
exit 1
fi
fi fi
# Guard: ensure we have a PR number before proceeding echo "::notice::Working with PR #${PR_NUMBER}"
if [ -z "$OPEN_PR" ]; then
echo "::error::Could not determine PR number for release/v${VERSION}."
exit 1
fi
echo "::notice::Working with PR #${OPEN_PR}"
# Check if PR was already merged (idempotency — safe to re-trigger after a stale branch) PR_STATE=$(curl -sf \
MERGED_CHECK=$(gh pr view "$OPEN_PR" --json state --jq '.state' 2>/dev/null) -H "Authorization: token ${GITEA_TOKEN}" \
if [ "$MERGED_CHECK" = "MERGED" ]; then "https://git.farh.net/api/v1/repos/${REPO}/pulls/${PR_NUMBER}" \
echo "::notice::PR #${OPEN_PR} was already merged. Nothing to do." | jq -r '.state' 2>/dev/null || echo "")
if [ "$PR_STATE" = "merged" ]; then
echo "::notice::PR #${PR_NUMBER} was already merged. Nothing to do."
exit 0 exit 0
fi fi
# Determine whether to use --auto or not based on current status.
# Retry the status check up to 3 times with exponential back-off when
# GitHub is still computing the merge state (UNKNOWN state).
MAX_RETRIES=3
BACKOFF=3
MERGE_STATE=""
for i in $(seq 1 $MAX_RETRIES); do
MERGE_STATE=$(gh pr view "$OPEN_PR" --json mergeStateStatus --jq '.mergeStateStatus' 2>/dev/null)
if [ "$MERGE_STATE" != "UNKNOWN" ]; then
break
fi
if [ $i -lt $MAX_RETRIES ]; then
echo "PR merge state is UNKNOWN (GitHub still computing). Retry ${i}/${MAX_RETRIES} in ${BACKOFF}s..."
sleep $BACKOFF
BACKOFF=$((BACKOFF * 2))
fi
done
if [ "$MERGE_STATE" = "BLOCKED" ] || [ "$MERGE_STATE" = "UNKNOWN" ]; then MERGE_RESULT=$(curl -sf -X POST \
echo "PR is $MERGE_STATE — attempting auto-merge (safe fallback, waits for branch protection checks)." -H "Authorization: token ${GITEA_TOKEN}" \
if gh pr merge "$OPEN_PR" --auto --squash --delete-branch 2>&1; then -H "Content-Type: application/json" \
echo "Auto-merge initiated successfully." "https://git.farh.net/api/v1/repos/${REPO}/pulls/${PR_NUMBER}/merge" \
else -d '{"do": "squash"}')
AUTO_MERGE_ERR=$? if echo "$MERGE_RESULT" | jq -e '.merged' 2>/dev/null; then
# If --auto failed because auto-merge is disabled for this repo echo "PR merged successfully."
# (autoMergeAllowed: false), fall back to --admin which merges
# regardless of branch protection rules. --admin requires GitHub
# App token, not GITHUB_TOKEN, so GH_TOKEN is already correct.
if gh pr merge "$OPEN_PR" --admin --squash --delete-branch 2>&1; then
echo "Auto-merge unavailable (autoMergeAllowed: false) — merged via --admin."
else
echo "::error::Both --auto and --admin merge failed. Exiting."
exit 1
fi
fi
else else
echo "PR is $MERGE_STATE — merging directly." if [ "$PR_STATE" = "merged" ]; then
gh pr merge "$OPEN_PR" --squash --delete-branch echo "PR was already merged."
else
echo "::warning::Merge response: $MERGE_RESULT"
fi
fi fi
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Verify checksums are consistent (main == tag == tarball) - name: Verify checksums are consistent (main == tag == tarball)
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
REPO: ${{ github.repository }}
run: | run: |
VERSION="${{ inputs.version }}" VERSION="${{ inputs.version }}"
TARBALL_CS=$(sha256sum "${{ env.TARBALL }}" | awk '{print $1}') TARBALL_CS=$(sha256sum "${{ env.TARBALL }}" | awk '{print $1}')
TAG_CS=$(git show "v${VERSION}:artifacthub-pkg.yml" 2>/dev/null \
# Checksum recorded in the tag's artifacthub-pkg.yml | grep "archive-checksum" | awk '{print $2}' | sed 's/sha256://')
TAG_CS=$(git show "v${VERSION}:artifacthub-pkg.yml" 2>/dev/null | grep "archive-checksum" | awk '{print $2}' | sed 's/sha256://') MAIN_CS=$(git fetch origin main 2>/dev/null; git show "origin/main:artifacthub-pkg.yml" \
| grep "archive-checksum" | awk '{print $2}' | sed 's/sha256://')
# Checksum now on main (after PR merge)
MAIN_CS=$(git fetch origin main 2>/dev/null; git show "origin/main:artifacthub-pkg.yml" | grep "archive-checksum" | awk '{print $2}' | sed 's/sha256://')
echo "Tarball SHA256 : $TARBALL_CS" echo "Tarball SHA256 : $TARBALL_CS"
echo "Tag artifacthub: $TAG_CS" echo "Tag artifacthub: $TAG_CS"
echo "Main artifacthub: $MAIN_CS" echo "Main artifacthub: $MAIN_CS"
FAIL=0 FAIL=0
[ "$TARBALL_CS" != "$TAG_CS" ] && echo "ERROR: tag checksum mismatch!" && FAIL=1 [ "$TARBALL_CS" != "$TAG_CS" ] && echo "ERROR: tag checksum mismatch!" && FAIL=1
[ "$TARBALL_CS" != "$MAIN_CS" ] && echo "ERROR: main checksum mismatch!" && FAIL=1 [ "$TARBALL_CS" != "$MAIN_CS" ] && echo "ERROR: main checksum mismatch!" && FAIL=1
[ "$FAIL" = "1" ] && exit 1 [ "$FAIL" = "1" ] && exit 1
echo "All checksums consistent — ArtifactHub will index correctly." echo "All checksums consistent — ArtifactHub will index correctly."
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
+9 -13
View File
@@ -12,19 +12,15 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: privilegedescalation
- name: Run Renovate - name: Run Renovate
uses: renovatebot/github-action@v41.0.0
with:
token: ${{ steps.app-token.outputs.token }}
configurationFile: renovate-config.json
env: env:
LOG_LEVEL: debug RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
RENOVATE_PLATFORM: gitea
RENOVATE_AUTODISCOVER: "true" RENOVATE_AUTODISCOVER: "true"
LOG_LEVEL: debug
run: |
npx renovate \
--token="${RENOVATE_TOKEN}" \
--platform=gitea \
--autodiscover=true \
--configurationFile=renovate-config.json