Update github action file

This commit is contained in:
شركة خبير المحدودة 2025-11-26 14:16:34 +02:00
parent 1c1a08dc50
commit 54ccffbf02
1 changed files with 29 additions and 29 deletions

View File

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