diff --git a/.gitea/workflows/nix-update.yml b/.gitea/workflows/nix-update.yml index c924902..1c2362a 100644 --- a/.gitea/workflows/nix-update.yml +++ b/.gitea/workflows/nix-update.yml @@ -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..."