You've already forked computing-box
Update .gitea/workflows/changelog.yml
Some checks failed
Changelog / changelog (push) Failing after 39s
Some checks failed
Changelog / changelog (push) Failing after 39s
This commit is contained in:
@@ -13,7 +13,6 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
# fetch-depth: 0 is important so git-cliff can see tags/history properly :contentReference[oaicite:3]{index=3}
|
|
||||||
|
|
||||||
- name: Generate CHANGELOG.md (Keep a Changelog)
|
- name: Generate CHANGELOG.md (Keep a Changelog)
|
||||||
uses: orhun/git-cliff-action@v4
|
uses: orhun/git-cliff-action@v4
|
||||||
@@ -23,18 +22,36 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
OUTPUT: CHANGELOG.md
|
OUTPUT: CHANGELOG.md
|
||||||
|
|
||||||
- name: Commit and push if changed
|
- name: Commit and push if changed (PAT)
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
CHANGELOG_PAT: ${{ secrets.CHANGELOG_PAT }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if git diff --quiet -- CHANGELOG.md; then
|
if git diff --quiet -- CHANGELOG.md; then
|
||||||
echo "No changelog changes."
|
echo "No changelog changes."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git config user.name "gitea-actions[bot]"
|
git config user.name "changelog-bot"
|
||||||
git config user.email "actions@localhost"
|
git config user.email "changelog-bot@users.noreply.local"
|
||||||
|
|
||||||
git add CHANGELOG.md
|
git add CHANGELOG.md
|
||||||
git commit -m "docs(changelog): update changelog [skip ci]"
|
git commit -m "docs(changelog): update changelog [skip ci]"
|
||||||
git push
|
|
||||||
|
# Push using PAT (avoid relying on built-in tokens)
|
||||||
|
# NOTE: This assumes your origin remote is already set by checkout.
|
||||||
|
origin_url="$(git remote get-url origin)"
|
||||||
|
|
||||||
|
# Convert SSH origin to HTTPS if needed
|
||||||
|
if echo "$origin_url" | grep -q "^git@"; then
|
||||||
|
host="$(echo "$origin_url" | sed -E 's#git@([^:]+):.*#\1#')"
|
||||||
|
path="$(echo "$origin_url" | sed -E 's#git@[^:]+:(.*)#\1#')"
|
||||||
|
origin_url="https://$host/$path"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Inject token (PAT) into HTTPS URL
|
||||||
|
authed_url="$(echo "$origin_url" | sed -E "s#^https://#https://oauth2:${CHANGELOG_PAT}@#")"
|
||||||
|
|
||||||
|
git push "$authed_url" HEAD:main
|
||||||
|
|||||||
Reference in New Issue
Block a user