Skip to content

Commit 1aee2cd

Browse files
still not??
1 parent 7e14b96 commit 1aee2cd

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/warn_direct_push.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,24 @@ jobs:
1818
run: |
1919
sudo apt install jq
2020
echo "error: Direct push was detected!!"
21-
PUSHER_GITHUB="${{ github.event.pusher.username }}"
21+
PUSHER_GITHUB=""
2222
echo " cause: $PUSHER_GITHUB's push"
2323
echo " help: This is not recommended."
2424
echo " help: Please revert those commit github."
2525
# TODO: checkout branch and revert default branch to base.
26-
PUSHER_DISCORD="$(echo '${{ secrets.DIRECT_PUSH_DETECTOR_USER_MAPS }}' | jq '[.[] | ({ key: .github[], value: .discord })] | from_entries" | jq -r ".$PUSHER_GITHUB")"
26+
PUSHER_DISCORD="$(echo '***' | jq '[.[] | ({ key: .github[], value: .discord })] | from_entries"' | jq -r ".$PUSHER_GITHUB")"
2727
PUSHER_DISCORD_MENTION=""
28-
if [ "$PUSHER_DISCORD" -eq "null" ]; then
29-
echo "warn: pusher's Discord numeric id could not found."
30-
echo " help: To solve this warning, please register $PUSHER_GITHUB explicitly."
31-
else
32-
PUSHER_DISCORD_MENTION="<@${PUSHER_DISCORD}>"
28+
if [ "$PUSHER_DISCORD" == "null" ]; then
29+
echo "warn: pusher's Discord numeric id could not found."
30+
echo " help: To solve this warning, please register $PUSHER_GITHUB explicitly."
31+
else
32+
PUSHER_DISCORD_MENTION="<@${PUSHER_DISCORD}>"
3333
fi
3434
3535
jq -n \
36-
--arg discord_user_mention "<@1>" \
37-
--arg iso8601_timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
38-
--arg github_repository https://github.com/KisaragiEffective/git-playground \
39-
'{"content":$discord_user_mention,"embeds":[{"title":"Direct push deteceted","description":"Direct push is not recommended. Please consider revert it and open equivalent Pull request.","url":$github_repository,"timestamp":$iso8601_timestamp,"color":16711680,"author":{"name":"GitHub Actions","url":"https://github.com/"}}]}' | \
40-
curl -d@- '${{ secrets.DIRECT_PUSH_DETECTOR_DISCORD_REPORT_WEBHOOK }}'
36+
--arg discord_user_mention "<@1>" \
37+
--arg iso8601_timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
38+
--arg github_repository https://github.com/KisaragiEffective/git-playground \
39+
'{"content":$discord_user_mention,"embeds":[{"title":"Direct push deteceted","description":"Direct push is not recommended. Please consider revert it and open equivalent Pull request.","url":$github_repository,"timestamp":$iso8601_timestamp,"color":16711680,"author":{"name":"GitHub Actions","url":"https://github.com/"}}]}' | \
40+
curl -d@- '***'
41+

0 commit comments

Comments
 (0)