mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +02:00
* fix(release): point repository URLs at renamed GitHub repo The GitHub repo was renamed from Kaelio/ktx to Kaelio/ktx-ai-data-agents-context. semantic-release reads repositoryUrl from package.json's repository field and the @semantic-release/github plugin failed verifyConditions with EMISMATCHGITHUBURL because it no longer matched the live clone URL. Update every Kaelio/ktx reference to the renamed repo: package metadata (root + CLI repository/bugs/homepage), the codecov upload slugs and star-history slug in CI, the issue-template and security-advisory links, the release runbook, and all docs/install commands. * fix(release): derive semantic-release repositoryUrl from the CI repo @semantic-release/github exact-matches repositoryUrl against the live GitHub clone_url (no redirect following), so any repo rename re-breaks the release when repositoryUrl is the static package.json value. Derive repositoryUrl from the runner's GITHUB_REPOSITORY/GITHUB_SERVER_URL so it always tracks the current repo name. A future rename (including back to Kaelio/ktx) now resolves with no code change. Outside CI the option is omitted, so semantic-release falls back to package.json as documented. The package.json repository field stays ktx-ai-data-agents-context as npm-display metadata, decoupled from the release-time match.
72 lines
2.8 KiB
YAML
72 lines
2.8 KiB
YAML
name: Refresh star history chart
|
|
|
|
on:
|
|
schedule:
|
|
# Twice daily at 06:00 and 18:00 UTC.
|
|
- cron: "0 6,18 * * *"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
DO_NOT_TRACK: "1"
|
|
KTX_TELEMETRY_DISABLED: "1"
|
|
NEXT_TELEMETRY_DISABLED: "1"
|
|
|
|
concurrency:
|
|
group: star-history-refresh
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
refresh:
|
|
name: Regenerate assets/star-history.svg
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
# RELEASE_PAT can push to the protected main branch; the default
|
|
# GITHUB_TOKEN is rejected by the branch-protection hook (GH006).
|
|
token: ${{ secrets.RELEASE_PAT }}
|
|
|
|
- name: Fetch fresh star-history SVG
|
|
run: |
|
|
set -euo pipefail
|
|
# cachebust forces star-history to regenerate instead of serving its
|
|
# own server-side cache; --location follows the slug-normalizing 301.
|
|
url="https://api.star-history.com/svg?repos=Kaelio/ktx-ai-data-agents-context&type=Date&cachebust=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
|
|
curl --fail --location --silent --show-error \
|
|
--retry 3 --retry-delay 5 --max-time 60 \
|
|
-o assets/star-history.svg.new "$url"
|
|
# Guard against error pages / truncated responses before overwriting.
|
|
if ! grep -q "</svg>" assets/star-history.svg.new; then
|
|
echo "Downloaded file is not a valid SVG; aborting." >&2
|
|
exit 1
|
|
fi
|
|
if [ "$(wc -c < assets/star-history.svg.new)" -lt 1000 ]; then
|
|
echo "Downloaded SVG is suspiciously small; aborting." >&2
|
|
exit 1
|
|
fi
|
|
# The star-history API returns the SVG without a trailing newline,
|
|
# which end-of-file-fixer rewrites whenever pre-commit runs
|
|
# --all-files on a PR. Because the refresh commit below uses [skip ci],
|
|
# the hook never runs against it here, so an un-normalized file
|
|
# silently breaks the pre-commit check on every open PR. Normalize to
|
|
# exactly one trailing newline before committing.
|
|
printf '%s\n' "$(cat assets/star-history.svg.new)" > assets/star-history.svg
|
|
rm -f assets/star-history.svg.new
|
|
|
|
- name: Commit if changed
|
|
run: |
|
|
set -euo pipefail
|
|
if git diff --quiet -- assets/star-history.svg; then
|
|
echo "Star-history chart unchanged; nothing to commit."
|
|
exit 0
|
|
fi
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git add assets/star-history.svg
|
|
# [skip ci] keeps this housekeeping commit from triggering KTX CI.
|
|
git commit -m "chore: refresh star history chart [skip ci]"
|
|
git push
|