Set environment variable branch name #1471

Closed
opened 2025-11-02 04:01:52 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @m47730 on GitHub (Jan 19, 2018).

I'm using a post hook script to automatic deploy a project of mine, and i'm using environment variables to do a simple script.
Everything is working except in the variables i miss the branch name. Is it possible to add it?
Sorry, i'm very new to gitea and go, so i haven't made a pull request.
I think is a useful addition without any harm.

For reference: #316 and #317

Thanks in advance

Originally created by @m47730 on GitHub (Jan 19, 2018). I'm using a post hook script to automatic deploy a project of mine, and i'm using environment variables to do a simple script. Everything is working except in the variables i miss the branch name. Is it possible to add it? Sorry, i'm very new to gitea and go, so i haven't made a pull request. I think is a useful addition without any harm. For reference: #316 and #317 Thanks in advance
GiteaMirror added the type/question label 2025-11-02 04:01:52 -06:00
Author
Owner

@lafriks commented on GitHub (Jan 19, 2018):

You can already get branch name from ref
See: https://stackoverflow.com/questions/7351551/writing-a-git-post-receive-hook-to-deal-with-a-specific-branch

@lafriks commented on GitHub (Jan 19, 2018): You can already get branch name from ref See: https://stackoverflow.com/questions/7351551/writing-a-git-post-receive-hook-to-deal-with-a-specific-branch
Author
Owner

@m47730 commented on GitHub (Jan 19, 2018):

i completely missed this information!
I rewrote some line of the script and now it's working as i like!

Thanks

@m47730 commented on GitHub (Jan 19, 2018): i completely missed this information! I rewrote some line of the script and now it's working as i like! Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1471