fix: use SSH authentication for Gitea Actions
This commit is contained in:
@@ -15,15 +15,15 @@ env:
|
|||||||
GIT_AUTHOR_EMAIL: 'bot@m3ta.dev'
|
GIT_AUTHOR_EMAIL: 'bot@m3ta.dev'
|
||||||
GIT_COMMITTER_NAME: 'nix-update bot'
|
GIT_COMMITTER_NAME: 'nix-update bot'
|
||||||
GIT_COMMITTER_EMAIL: 'bot@m3ta.dev'
|
GIT_COMMITTER_EMAIL: 'bot@m3ta.dev'
|
||||||
GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -o IdentitiesOnly=yes -o StrictHostKeyChecking=no"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nix-update:
|
nix-update:
|
||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
steps:
|
steps:
|
||||||
- name: Setup SSH key
|
- name: Setup SSH
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
chmod 700 ~/.ssh
|
||||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/id_rsa
|
||||||
ssh-keyscan code.m3ta.dev >> ~/.ssh/known_hosts
|
ssh-keyscan code.m3ta.dev >> ~/.ssh/known_hosts
|
||||||
@@ -33,6 +33,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
persist-credentials: true
|
||||||
|
|
||||||
- name: Check for available packages to update
|
- name: Check for available packages to update
|
||||||
id: check-packages
|
id: check-packages
|
||||||
@@ -174,7 +175,7 @@ jobs:
|
|||||||
|
|
||||||
echo "Pushing branch ${BRANCH}..."
|
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)
|
git push origin "${BRANCH}" || (git fetch origin "${BRANCH}" 2>/dev/null && git push origin "${BRANCH}" --force)
|
||||||
|
|
||||||
echo "Creating pull request..."
|
echo "Creating pull request..."
|
||||||
|
|||||||
Reference in New Issue
Block a user