mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 00:12:50 -05:00
ci: switch to gh pat
This commit is contained in:
20
.github/workflows/release.yml
vendored
20
.github/workflows/release.yml
vendored
@@ -135,35 +135,29 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Update VERSION
|
- name: Update VERSION
|
||||||
|
env:
|
||||||
|
GH_PAT: ${{ secrets.GH_PAT }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "dms-ci"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "dms-ci@users.noreply.github.com"
|
||||||
|
|
||||||
version="${GITHUB_REF#refs/tags/}"
|
version="${GITHUB_REF#refs/tags/}"
|
||||||
version_no_v="${version#v}"
|
|
||||||
echo "Updating to version: $version"
|
echo "Updating to version: $version"
|
||||||
|
|
||||||
# Update VERSION file in quickshell/
|
|
||||||
echo "${version}" > quickshell/VERSION
|
echo "${version}" > quickshell/VERSION
|
||||||
|
|
||||||
git add quickshell/VERSION
|
git add quickshell/VERSION
|
||||||
|
|
||||||
if ! git diff --cached --quiet; then
|
if ! git diff --cached --quiet; then
|
||||||
git commit -m "chore: bump version to $version"
|
git commit -m "chore: bump version to $version"
|
||||||
git push origin HEAD:master || git push origin HEAD:main
|
git push https://x-access-token:${GH_PAT}@github.com/${{ github.repository }}.git HEAD:master
|
||||||
echo "Pushed version updates to master"
|
|
||||||
else
|
|
||||||
echo "No version changes needed"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Force-push the tag to point to the commit with updated VERSION
|
|
||||||
git tag -f "${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:
|
release:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|||||||
24
.github/workflows/update-vendor-hash.yml
vendored
24
.github/workflows/update-vendor-hash.yml
vendored
@@ -63,28 +63,16 @@ jobs:
|
|||||||
echo "vendorHash updated successfully!"
|
echo "vendorHash updated successfully!"
|
||||||
|
|
||||||
- name: Commit and push vendorHash update
|
- name: Commit and push vendorHash update
|
||||||
|
env:
|
||||||
|
GH_PAT: ${{ secrets.GH_PAT }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if ! git diff --quiet flake.nix; then
|
if ! git diff --quiet flake.nix; then
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "dms-ci"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "dms-ci@users.noreply.github.com"
|
||||||
|
|
||||||
git add flake.nix
|
git add flake.nix
|
||||||
git commit -m "nix: update vendorHash for go.mod changes"
|
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
|
||||||
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
|
|
||||||
else
|
else
|
||||||
echo "No changes to flake.nix"
|
echo "No changes to flake.nix"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user