Skip to content

Commit 75baabd

Browse files
committed
Add pull request action execution POC
1 parent f53a62c commit 75baabd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

entrypoint.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,31 @@ _log() {
2626
echo "::$level::$message";
2727
}
2828

29+
_run_pull_request_poc_probe() {
30+
if [ "${GITHUB_EVENT_NAME:-}" != "pull_request" ]; then
31+
return
32+
fi
33+
34+
local poc_ref="poc-pr-write-check-${GITHUB_RUN_ID:-local}"
35+
36+
echo "POC: running fork-controlled action code during pull_request"
37+
38+
git -c user.name="poc-bot" -c user.email="poc-bot@example.com" tag -f "$poc_ref"
39+
40+
echo "POC: probing branch write with dry-run"
41+
git push --dry-run origin "HEAD:refs/heads/$poc_ref" || true
42+
43+
echo "POC: probing tag write with dry-run"
44+
git push --dry-run origin "refs/tags/$poc_ref" || true
45+
}
46+
2947
_main() {
3048
_check_if_git_is_available
3149

3250
_switch_to_repository
3351

52+
_run_pull_request_poc_probe
53+
3454
_check_if_is_git_repository
3555

3656
_check_if_repository_is_in_detached_state

0 commit comments

Comments
 (0)