Gitea reserves the GITEA_ prefix for secret names, so the workflow secret can't be GITEA_TOKEN. Rename it (and the env var the script reads) to BUMP_TOKEN. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -26,9 +26,9 @@ jobs:
|
||||
|
||||
- name: Check for new release and open PR
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
BUMP_TOKEN: ${{ secrets.BUMP_TOKEN }}
|
||||
run: |
|
||||
host=${GITHUB_SERVER_URL#http://}; host=${host#https://}
|
||||
curl -fsSL "http://x-access-token:${GITEA_TOKEN}@${host}/${GITHUB_REPOSITORY}/raw/branch/master/scripts/bump-version.sh" \
|
||||
curl -fsSL "http://x-access-token:${BUMP_TOKEN}@${host}/${GITHUB_REPOSITORY}/raw/branch/master/scripts/bump-version.sh" \
|
||||
-o /tmp/bump-version.sh
|
||||
bash /tmp/bump-version.sh
|
||||
|
||||
@@ -26,5 +26,5 @@ emerge dev-util/gitea-runner
|
||||
every push and asserts the resulting binary runs.
|
||||
- `.gitea/workflows/bump.yaml` runs `scripts/bump-version.sh` daily: it checks the
|
||||
upstream releases feed and, when a newer version exists, regenerates + uploads the
|
||||
vendor tarball, bumps the ebuild, and opens a pull request. Requires a `GITEA_TOKEN`
|
||||
vendor tarball, bumps the ebuild, and opens a pull request. Requires a `BUMP_TOKEN`
|
||||
repository secret (scopes: repository read/write, write release).
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# ebuild, regenerate the Manifest, and open a pull request.
|
||||
#
|
||||
# Expects a Gentoo environment with: go, pkgdev, git, curl, xz, jq.
|
||||
# Required env: GITEA_TOKEN, GITHUB_SERVER_URL, GITHUB_REPOSITORY.
|
||||
# Required env: BUMP_TOKEN, GITHUB_SERVER_URL, GITHUB_REPOSITORY.
|
||||
# Optional env: GITHUB_API_URL (defaults to ${GITHUB_SERVER_URL}/api/v1).
|
||||
set -euo pipefail
|
||||
|
||||
@@ -13,13 +13,13 @@ UPSTREAM_RSS="https://gitea.com/gitea/runner/releases.rss"
|
||||
UPSTREAM_ARCHIVE="https://gitea.com/gitea/runner/archive"
|
||||
UPSTREAM_GOMOD="https://gitea.com/gitea/runner/raw/tag"
|
||||
|
||||
: "${GITEA_TOKEN:?GITEA_TOKEN is required}"
|
||||
: "${BUMP_TOKEN:?BUMP_TOKEN is required}"
|
||||
: "${GITHUB_SERVER_URL:?GITHUB_SERVER_URL is required}"
|
||||
: "${GITHUB_REPOSITORY:?GITHUB_REPOSITORY is required}"
|
||||
API="${GITHUB_API_URL:-${GITHUB_SERVER_URL}/api/v1}"
|
||||
|
||||
host=${GITHUB_SERVER_URL#http://}; host=${host#https://}
|
||||
api() { curl -fsSL -H "Authorization: token ${GITEA_TOKEN}" "$@"; }
|
||||
api() { curl -fsSL -H "Authorization: token ${BUMP_TOKEN}" "$@"; }
|
||||
|
||||
# --- determine versions ------------------------------------------------------
|
||||
latest=$(curl -fsSL "$UPSTREAM_RSS" \
|
||||
@@ -28,7 +28,7 @@ latest=$(curl -fsSL "$UPSTREAM_RSS" \
|
||||
[ -n "$latest" ] || { echo "could not parse upstream version"; exit 1; }
|
||||
|
||||
WORK=$(mktemp -d)
|
||||
git clone "https://x-access-token:${GITEA_TOKEN}@${host}/${GITHUB_REPOSITORY}.git" "$WORK"
|
||||
git clone "https://x-access-token:${BUMP_TOKEN}@${host}/${GITHUB_REPOSITORY}.git" "$WORK"
|
||||
cd "$WORK"
|
||||
pkgdir="dev-util/${PN}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user