fix: use SSH authentication for Gitea Actions

This commit is contained in:
m3tm3re
2026-01-15 19:40:37 +01:00
parent 5fc17c71a3
commit 8cd56cfd97

View File

@@ -15,15 +15,15 @@ env:
GIT_AUTHOR_EMAIL: 'bot@m3ta.dev'
GIT_COMMITTER_NAME: 'nix-update bot'
GIT_COMMITTER_EMAIL: 'bot@m3ta.dev'
GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -o IdentitiesOnly=yes -o StrictHostKeyChecking=no"
jobs:
nix-update:
runs-on: nixos
steps:
- name: Setup SSH key
- name: Setup SSH
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan code.m3ta.dev >> ~/.ssh/known_hosts
@@ -33,6 +33,7 @@ jobs:
with:
fetch-depth: 0
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
persist-credentials: true
- name: Check for available packages to update
id: check-packages
@@ -174,7 +175,7 @@ jobs:
echo "Pushing branch ${BRANCH}..."
git remote set-url origin git@code.m3ta.dev:m3tam3re/nixpkgs.git
# Push the branch
git push origin "${BRANCH}" || (git fetch origin "${BRANCH}" 2>/dev/null && git push origin "${BRANCH}" --force)
echo "Creating pull request..."