Skip to content

Commit

Permalink
fix: verify changed files from bbnRepo (babylonchain#46)
Browse files Browse the repository at this point in the history
* fix: verify changed files from bbnRepo

* fix: check if main branch being merged is from bbn origin
  • Loading branch information
RafilxTenfen authored May 17, 2024
1 parent 21073cb commit 3da2da5
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,14 @@ jobs:
- run:
name: Verify signature
command: |
originUrl=$(git remote get-url origin)
currBranch=$(git rev-parse --abbrev-ref HEAD)
if [ "main" == "$currBranch" ]; then
if [ "main" == "$currBranch" ] && [ *"babylonchain/networks.git"* == "$originUrl" ]; then
ALL_CHANGED_FILES=$(git diff HEAD~1 --name-only **/finality-providers/registry/)
else
ALL_CHANGED_FILES=$(git diff main --name-only **/finality-providers/registry/)
git remote add bbnRepo https://github.com/babylonchain/networks.git
git fetch bbnRepo main
ALL_CHANGED_FILES=$(git diff bbnRepo/main --name-only **/finality-providers/registry/)
fi
echo "ALL_CHANGED_FILES" $ALL_CHANGED_FILES
Expand Down Expand Up @@ -108,11 +111,14 @@ jobs:
- run:
name: Verify offchain signed transaction
command: |
originUrl=$(git remote get-url origin)
currBranch=$(git rev-parse --abbrev-ref HEAD)
if [ "main" == "$currBranch" ]; then
if [ "main" == "$currBranch" ] && [ *"babylonchain/networks.git"* == "$originUrl" ]; then
ALL_CHANGED_FILES=$(git diff HEAD~1 --name-only **/finality-providers/registry/)
else
ALL_CHANGED_FILES=$(git diff main --name-only **/finality-providers/registry/)
git remote add bbnRepo https://github.com/babylonchain/networks.git
git fetch bbnRepo main
ALL_CHANGED_FILES=$(git diff bbnRepo/main --name-only **/finality-providers/registry/)
fi
echo "ALL_CHANGED_FILES" $ALL_CHANGED_FILES
Expand Down Expand Up @@ -148,11 +154,14 @@ jobs:
- run:
name: Verify onchain BTC transaction
command: |
originUrl=$(git remote get-url origin)
currBranch=$(git rev-parse --abbrev-ref HEAD)
if [ "main" == "$currBranch" ]; then
if [ "main" == "$currBranch" ] && [ *"babylonchain/networks.git"* == "$originUrl" ]; then
ALL_CHANGED_FILES=$(git diff HEAD~1 --name-only **/finality-providers/registry/)
else
ALL_CHANGED_FILES=$(git diff main --name-only **/finality-providers/registry/)
git remote add bbnRepo https://github.com/babylonchain/networks.git
git fetch bbnRepo main
ALL_CHANGED_FILES=$(git diff bbnRepo/main --name-only **/finality-providers/registry/)
fi
echo "ALL_CHANGED_FILES" $ALL_CHANGED_FILES
Expand Down

0 comments on commit 3da2da5

Please sign in to comment.