1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

ci: switch to gh pat

This commit is contained in:
bbedward
2025-11-30 01:20:19 -05:00
parent 1b4363a54a
commit 7f6a71b964
2 changed files with 13 additions and 31 deletions

View File

@@ -135,35 +135,29 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GH_PAT }}
fetch-depth: 0
- name: Update VERSION
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "dms-ci"
git config user.email "dms-ci@users.noreply.github.com"
version="${GITHUB_REF#refs/tags/}"
version_no_v="${version#v}"
echo "Updating to version: $version"
# Update VERSION file in quickshell/
echo "${version}" > quickshell/VERSION
git add quickshell/VERSION
if ! git diff --cached --quiet; then
git commit -m "chore: bump version to $version"
git push origin HEAD:master || git push origin HEAD:main
echo "Pushed version updates to master"
else
echo "No version changes needed"
git push https://x-access-token:${GH_PAT}@github.com/${{ github.repository }}.git HEAD:master
fi
# Force-push the tag to point to the commit with updated VERSION
git tag -f "${version}"
git push -f origin "${version}"
git push -f https://x-access-token:${GH_PAT}@github.com/${{ github.repository }}.git "${version}"
release:
runs-on: ubuntu-24.04

View File

@@ -63,28 +63,16 @@ jobs:
echo "vendorHash updated successfully!"
- name: Commit and push vendorHash update
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
set -euo pipefail
if ! git diff --quiet flake.nix; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "dms-ci"
git config user.email "dms-ci@users.noreply.github.com"
git add flake.nix
git commit -m "nix: update vendorHash for go.mod changes"
for attempt in 1 2 3; do
if git push; then
echo "Successfully pushed vendorHash update"
exit 0
fi
echo "Push attempt $attempt failed, pulling and retrying..."
git pull --rebase
sleep $((attempt*2))
done
echo "Failed to push after retries" >&2
exit 1
git commit -m "nix: update vendorHash for go.mod changes" || exit 0
git push https://x-access-token:${GH_PAT}@github.com/${{ github.repository }}.git HEAD:master
else
echo "No changes to flake.nix"
fi