From 47325b4e529f900de891fcdb88e1c6cacff2de1a Mon Sep 17 00:00:00 2001 From: janniks Date: Sat, 3 Aug 2024 01:14:33 +0200 Subject: [PATCH] chore: update sha parse --- .github/workflows/run-regtest-tests.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-regtest-tests.yml b/.github/workflows/run-regtest-tests.yml index d94a1f0..1d5aa3a 100644 --- a/.github/workflows/run-regtest-tests.yml +++ b/.github/workflows/run-regtest-tests.yml @@ -39,6 +39,20 @@ jobs: path: /tmp/regtest-env key: ${{ runner.os }}-regtest-env + - name: Determine core commit SHA + id: core-commit + run: | + core_commit=${{ github.event.inputs.core_commit || 'develop' }} + if git ls-remote --exit-code --heads https://github.com/stacks-network/stacks-core.git $core_commit; then + core_commit_sha=$(git ls-remote https://github.com/stacks-network/stacks-core.git $core_commit | awk '{print $1}') + elif git ls-remote --exit-code --refs https://github.com/stacks-network/stacks-core.git $core_commit; then + core_commit_sha=$core_commit + else + echo "Invalid core_commit: $core_commit" + exit 1 + fi + echo "::set-output name=sha::$core_commit_sha" + - name: Clone regtest-env run: | if [ ! -d "/tmp/regtest-env" ]; then @@ -52,7 +66,7 @@ jobs: - name: Prepare regtest-env run: | cd /tmp/regtest-env - sed -i 's/\(&STACKS_BLOCKCHAIN_COMMIT \).*/\1${{ github.event.inputs.core_commit || 'develop' }}/' docker-compose.yml + sed -i 's/\(&STACKS_BLOCKCHAIN_COMMIT \).*/\1${{ steps.core-commit.outputs.sha }}/' docker-compose.yml sed -i 's/\(&MINE_INTERVAL_EPOCH25 \).*/\12s/' docker-compose.yml sed -i 's/\(&MINE_INTERVAL_EPOCH3 \).*/\16s/' docker-compose.yml sed -i 's/\(&&NAKAMOTO_BLOCK_INTERVAL \).*/\14s/' docker-compose.yml