Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
Signed-off-by: borg-z <me@nikolay-z.top>
  • Loading branch information
borg-z committed Feb 24, 2025
1 parent e1ab015 commit 4cdfbfd
Showing 1 changed file with 2 additions and 36 deletions.
38 changes: 2 additions & 36 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,10 @@ jobs:
ssh-private-key: |
${{secrets.SOURCE_REPO_SSH_KEY}}
- name: Add ssh_known_hosts
run: |
HOST=${{ secrets.SOURCE_REPO_GIT }}
echo "::add-mask::$HOST"
IPS=$(nslookup "$HOST" | awk '/^Address: / { print $2 }')
for IP in $IPS; do
echo "::add-mask::$IP"
done
mkdir -p ~/.ssh
touch ~/.ssh/known_hosts
HOST_KEYS=$(ssh-keyscan -H "$HOST" 2>/dev/null)
echo "$HOST_KEYS" | while IFS= read -r KEY_LINE; do
CONSTANT_PART=$(echo "$KEY_LINE" | awk '{print $2, $3}')
if ! grep -q "$CONSTANT_PART" ~/.ssh/known_hosts; then
echo "$KEY_LINE" >> ~/.ssh/known_hosts
fi
done
- name: Setup git
run: |
git config --global url."ssh://git@${SOURCE_REPO_GIT}/".insteadOf "https://flant.internal/"
git config --global core.sshCommand "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
git config --global --add safe.directory '*'
- name: Build and package
Expand Down Expand Up @@ -111,27 +94,10 @@ jobs:
ssh-private-key: |
${{secrets.SOURCE_REPO_SSH_KEY}}
- name: Add ssh_known_hosts
run: |
HOST=${{ secrets.SOURCE_REPO_GIT }}
echo "::add-mask::$HOST"
IPS=$(nslookup "$HOST" | awk '/^Address: / { print $2 }')
for IP in $IPS; do
echo "::add-mask::$IP"
done
mkdir -p ~/.ssh
touch ~/.ssh/known_hosts
HOST_KEYS=$(ssh-keyscan -H "$HOST" 2>/dev/null)
echo "$HOST_KEYS" | while IFS= read -r KEY_LINE; do
CONSTANT_PART=$(echo "$KEY_LINE" | awk '{print $2, $3}')
if ! grep -q "$CONSTANT_PART" ~/.ssh/known_hosts; then
echo "$KEY_LINE" >> ~/.ssh/known_hosts
fi
done
- name: Setup git
run: |
git config --global url."ssh://git@${SOURCE_REPO_GIT}/".insteadOf "https://flant.internal/"
git config --global core.sshCommand "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
git config --global --add safe.directory '*'
- name: Run tests
Expand Down

0 comments on commit 4cdfbfd

Please sign in to comment.