Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
0xDEnYO committed Jul 25, 2024
1 parent 6b07b47 commit 7225941
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/diamondEmergencyPause.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Diamond Emergency Pause
name: Pause PRODUCTION diamond (CAREFUL)

on:
push:
Expand All @@ -8,34 +8,34 @@ jobs:
diamond-emergency-pause:
runs-on: ubuntu-latest

# steps:
# - name: Check user permissions
# id: check_user
# run: |
# ALLOWED_USERS=("0xDEnYO" "maxklenk" "ezynda3")
# if [[ ! " ${ALLOWED_USERS[@]} " =~ " ${{ github.actor }} " ]]; then
# echo "User ${{ github.actor }} is not allowed to run this workflow."
# exit 1
# fi
# shell: bash

steps:
- name: Check user permissions
id: check_user
- name: Check if action was triggered by a member of Github "DiamondPauser" group
id: authenticate
run: |
ALLOWED_USERS=("0xDEnYO" "maxklenk" "ezynda3")
if [[ ! " ${ALLOWED_USERS[@]} " =~ " ${{ github.actor }} " ]]; then
echo "User ${{ github.actor }} is not allowed to run this workflow."
TEAM_NAME="DiamondPauser"
ORG_NAME="lifinance"
USER=${{ github.actor }}
RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/orgs/$ORG_NAME/teams/$TEAM_NAME/memberships/$USER")

if echo "$RESPONSE" | grep -q '"state": "active"'; then
echo "User $USER is a member of team $TEAM_NAME."
else
echo "User $USER is not a member of team $TEAM_NAME."
exit 1
fi
shell: bash

# steps:
# - name: Check team membership
# id: check_team
# run: |
# TEAM_NAME="DiamondPauser"
# ORG_NAME="lifinance"
# USER=${{ github.actor }}
# RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/orgs/$ORG_NAME/teams/$TEAM_NAME/memberships/$USER")

# if echo "$RESPONSE" | grep -q '"state": "active"'; then
# echo "User $USER is a member of team $TEAM_NAME."
# else
# echo "User $USER is not a member of team $TEAM_NAME."
# exit 1
# fi
# shell: bash

- name: Checkout repository
uses: actions/checkout@v2
with:
Expand Down
1 change: 1 addition & 0 deletions script/tasks/diamondEMERGENCYPauseGitHub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function handleNetwork() {
while [ $ATTEMPTS -le $MAX_ATTEMPTS ]; do
echo ""
echo "[network: $NETWORK] pausing diamond $DIAMOND_ADDRESS now from PauserWallet: $PRIV_KEY_ADDRESS (attempt: $ATTEMPTS)"
echo ""
cast send "$DIAMOND_ADDRESS" "pauseDiamond()" --private-key "$PRIVATE_KEY_PAUSER_WALLET" --rpc-url "$RPC_URL" --legacy

# check the return code of the last call
Expand Down

0 comments on commit 7225941

Please sign in to comment.