Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit URL environment variable #11738

Closed
sshaikh opened this issue Jun 2, 2020 · 4 comments · Fixed by #12752
Closed

Commit URL environment variable #11738

sshaikh opened this issue Jun 2, 2020 · 4 comments · Fixed by #12752

Comments

@sshaikh
Copy link

sshaikh commented Jun 2, 2020

As well as GITEA_REPO_NAME and GITEA_REPO_USER_NAME, something like GITEA_COMMIT_URL would be great to push out by post_receive scripts. At the moment I'm constructing them (not a big deal).

@stale
Copy link

stale bot commented Aug 1, 2020

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label Aug 1, 2020
@sshaikh
Copy link
Author

sshaikh commented Aug 1, 2020

I'd still find this useful

@stale stale bot removed the issue/stale label Aug 1, 2020
@zeripath
Copy link
Contributor

@sshaikh Do you mean you'd like the environment variable GITEA_COMMIT_URL to be set to say: https://gitea.com/xorm/xorm/commit/76d6b9fdf55b1cc4ed9a8bb8b1cdc0910cdff92e

That doesn't make sense. The best we could provide would be to set the gitea APP_URL as an environment variable.

Git's post-receive scripts receive on stdin the list of refs changed: [1]

<old-SHA> SP <new-SHA> SP <ref-name> LF

Any number of commits may have occurred between old-SHA and new-SHA and any number of refs might be updated. You will always have to regenerate the urls yourself.

[1] https://git-scm.com/docs/githooks#pre-receive

@sshaikh
Copy link
Author

sshaikh commented Aug 31, 2020

Yes, I actually meant the URL up until the username part, so APP_URL would probably be a better name.

zeripath added a commit to zeripath/gitea that referenced this issue Sep 6, 2020
techknowlogick pushed a commit that referenced this issue Sep 7, 2020
…es (#12752)

* Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes

Fix #11738

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants