Update github action file
This commit is contained in:
parent
ad91fcb30d
commit
299fb3e154
|
|
@ -23,38 +23,38 @@ jobs:
|
|||
#######################################################
|
||||
# 🟦 1) Allowed Users List
|
||||
#######################################################
|
||||
ALLOWED_USERS=(
|
||||
"expsa"
|
||||
"moutazmuhammad"
|
||||
"ronozoro"
|
||||
"Abubaker-Altaib"
|
||||
"altexp"
|
||||
"the5abir"
|
||||
"ahmadaking"
|
||||
"kchyounes19"
|
||||
"abdurrahman-saber"
|
||||
"maltayyar2"
|
||||
"esam-sermah"
|
||||
"mohammed-alkhazrji"
|
||||
)
|
||||
# ALLOWED_USERS=(
|
||||
# "expsa"
|
||||
# "moutazmuhammad"
|
||||
# "ronozoro"
|
||||
# "Abubaker-Altaib"
|
||||
# "altexp"
|
||||
# "the5abir"
|
||||
# "ahmadaking"
|
||||
# "kchyounes19"
|
||||
# "abdurrahman-saber"
|
||||
# "maltayyar2"
|
||||
# "esam-sermah"
|
||||
# "mohammed-alkhazrji"
|
||||
# )
|
||||
|
||||
IS_ALLOWED="false"
|
||||
for user in "${ALLOWED_USERS[@]}"; do
|
||||
if [[ "$CREATOR" == "$user" ]]; then
|
||||
IS_ALLOWED="true"
|
||||
break
|
||||
fi
|
||||
done
|
||||
# IS_ALLOWED="false"
|
||||
# for user in "${ALLOWED_USERS[@]}"; do
|
||||
# if [[ "$CREATOR" == "$user" ]]; then
|
||||
# IS_ALLOWED="true"
|
||||
# break
|
||||
# fi
|
||||
# done
|
||||
|
||||
if [[ "$IS_ALLOWED" == "false" ]]; then
|
||||
echo "❌ User '$CREATOR' is NOT allowed to create branches. Deleting..."
|
||||
curl -s -X DELETE \
|
||||
-H "Authorization: token $GH_TOKEN" \
|
||||
https://api.github.com/repos/$REPO/git/refs/heads/$BRANCH_NAME
|
||||
exit 1
|
||||
fi
|
||||
# if [[ "$IS_ALLOWED" == "false" ]]; then
|
||||
# echo "❌ User '$CREATOR' is NOT allowed to create branches. Deleting..."
|
||||
# curl -s -X DELETE \
|
||||
# -H "Authorization: token $GH_TOKEN" \
|
||||
# https://api.github.com/repos/$REPO/git/refs/heads/$BRANCH_NAME
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
echo "✔ User '$CREATOR' is allowed."
|
||||
# echo "✔ User '$CREATOR' is allowed."
|
||||
|
||||
#######################################################
|
||||
# 🟦 2) Reserved Branch Names (Your Existing List)
|
||||
|
|
|
|||
Loading…
Reference in New Issue