Skip to content

actions ref_name is returning full ref ("ref/heads/*") instead of shortened name #25357

Closed
@nephatrine

Description

@nephatrine

Description

I decided to try 1.20.0-rc0 (had been using 1.19.3) and noticed what I believe to be a regression. When using ${{ gitea.ref_name }} in my actions to get the branch name, I'm now getting something like ref/heads/main instead of just main. Per the documentation and prior behaviour, I believe it should only be returning the name.

I have not tried fixing the issue myself, but I think the issue is that it is being set to refName.String() instead of refName.ShortName() in routers/api/actions/runner/utils.go.

Gitea Version

1.20.0-rc0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Alpine 3.18

How are you running Gitea?

I'm building it myself from the 1.20.0-rc0 tag and running it inside an alpine:latest docker container.

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions