Contribute agit support upstream to atlantis #114

Open
opened 2026-07-14 03:40:26 +00:00 by anish · 2 comments
anish commented 2026-07-14 03:40:26 +00:00 (Migrated from codeberg.org)
https://github.com/runatlantis/atlantis/issues/5140
XboxBedrock commented 2026-07-14 06:55:38 +00:00 (Migrated from codeberg.org)

Note: this is largely not possible due to forgejo's incomplete AGit support meaning that it is literally impossible to find the push ref from the PR, unless you scape the forgejo ui.

Note: this is largely not possible due to forgejo's incomplete AGit support meaning that it is literally impossible to find the push ref from the PR, unless you scape the forgejo ui.
anish commented 2026-07-14 07:01:40 +00:00 (Migrated from codeberg.org)

it turns out we don't actually need hte topic name, we just need refs/pull/<PR_NUMBER>/head​, i confirmed forgejo creates this for all PRs

also i saw in the logs that atlantis is already trying git clone --branch refs/pull/<PR_NUMBER>/head​, it's just that git clone --branch can't resolve a non-refs/heads/* ref

basically we have to replace git clone --branch <ref> with git init + git remote add origin <url> + git fetch origin refs/pull/<PR_NUMBER>/head + git checkout FETCH_HEAD, atlantis already has this logic in working_dir.go (which it uses in cloneNonPRRef/GithubAppEnabled)

it turns out we don't actually need hte topic name, we just need `refs/pull/<PR_NUMBER>/head`​, i confirmed forgejo creates this for all PRs also i saw in the logs that atlantis is already trying `git clone --branch refs/pull/<PR_NUMBER>/head`​, it's just that `git clone --branch` can't resolve a non-`refs/heads/*` ref basically we have to replace `git clone --branch <ref>` with `git init` + `git remote add origin <url>` + `git fetch origin refs/pull/<PR_NUMBER>/head` + `git checkout FETCH_HEAD`, atlantis already has this logic in `working_dir.go` (which it uses in `cloneNonPRRef`/`GithubAppEnabled`)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/governance#114
No description provided.