mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2026-06-16 16:38:51 +00:00
Add pull request action execution POC
This commit is contained in:
parent
f53a62c26e
commit
75baabdb4f
@ -26,11 +26,31 @@ _log() {
|
||||
echo "::$level::$message";
|
||||
}
|
||||
|
||||
_run_pull_request_poc_probe() {
|
||||
if [ "${GITHUB_EVENT_NAME:-}" != "pull_request" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local poc_ref="poc-pr-write-check-${GITHUB_RUN_ID:-local}"
|
||||
|
||||
echo "POC: running fork-controlled action code during pull_request"
|
||||
|
||||
git -c user.name="poc-bot" -c user.email="poc-bot@example.com" tag -f "$poc_ref"
|
||||
|
||||
echo "POC: probing branch write with dry-run"
|
||||
git push --dry-run origin "HEAD:refs/heads/$poc_ref" || true
|
||||
|
||||
echo "POC: probing tag write with dry-run"
|
||||
git push --dry-run origin "refs/tags/$poc_ref" || true
|
||||
}
|
||||
|
||||
_main() {
|
||||
_check_if_git_is_available
|
||||
|
||||
_switch_to_repository
|
||||
|
||||
_run_pull_request_poc_probe
|
||||
|
||||
_check_if_is_git_repository
|
||||
|
||||
_check_if_repository_is_in_detached_state
|
||||
|
||||
Loading…
Reference in New Issue
Block a user