diff --git a/.github/workflows/roa.yml b/.github/workflows/roa.yml index 4a069f2..3aa5c69 100644 --- a/.github/workflows/roa.yml +++ b/.github/workflows/roa.yml @@ -18,7 +18,6 @@ jobs: - uses: actions/checkout@v2 with: repository: NeoCloud/NeoNetwork-ROA - ssh-key: ${{ secrets.KEY }} path: generated - name: Install dependencies @@ -30,9 +29,6 @@ jobs: run: .scripts/generate-roa.sh - name: Push to NeoCloud/NeoNetwork-ROA - run: | - cd generated - git config user.name "neonet roa bot" - git config user.email "bot@github.com" - git commit -m "Generated at $(TZ='UTC' date +%Y%m%d-%H%M%S.%N)" - git push + run: .scripts/push-to-roa.sh + env: + SSHPRIVKEY: ${{ secrets.KEY }} diff --git a/.github/workflows/test-your-pr.yml b/.github/workflows/test-your-pr.yml index 9b9a0d5..1858beb 100644 --- a/.github/workflows/test-your-pr.yml +++ b/.github/workflows/test-your-pr.yml @@ -1,11 +1,8 @@ -# This is a basic workflow to help you get started with Actions - name: Test Your PR on: pull_request: - branches: - - master + branches: [master] jobs: build: diff --git a/.scripts/push-to-roa.sh b/.scripts/push-to-roa.sh index fb4f123..d692470 100755 --- a/.scripts/push-to-roa.sh +++ b/.scripts/push-to-roa.sh @@ -1,17 +1,20 @@ #!/usr/bin/env bash -set -xeuo pipefail +set -euo pipefail IFS=$'\n\t' -pushd roa_dir if [ -n "$SSHPRIVKEY" ]; then echo SSHPRIVKEY is not set exit 1 fi + mkdir -p "$HOME/.ssh" echo "$SSHPRIVKEY" | base64 -d >"$HOME/.ssh/id_ed25519" chmod 0600 "$HOME/.ssh/id_ed25519" -ssh -o StrictHostKeyChecking=no git@github.com || true -git init && git add . + +set -x + +pushd generated +git add . git config user.name "neonet roa bot" git config user.email "bot@github.com" git commit -m "Generated at $(TZ='UTC' date +%Y%m%d-%H%M%S.%N)"