fix: use SSH authentication for Gitea Actions
This commit is contained in:
@@ -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..."
|
||||
|
||||
Reference in New Issue
Block a user