Unable to add actions variable if it starts with ci #14725

Open
opened 2025-11-02 11:21:18 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @balporig on GitHub (Jul 8, 2025).

Description

Adding any action variable that start with ci does not work. For example CI_USER

errorMessage	"Failed to add variable."

Gitea Version

v1.24.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker container

Database

PostgreSQL

Originally created by @balporig on GitHub (Jul 8, 2025). ### Description Adding any action variable that start with `ci` does not work. For example `CI_USER` ```bash errorMessage "Failed to add variable." ``` ### Gitea Version v1.24.2 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Docker container ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 11:21:18 -06:00
Author
Owner

@techknowlogick commented on GitHub (Jul 8, 2025):

Thank you for your report. CI_ GITEA_ and GITHUB_ are reserved prefixes for variables.

@techknowlogick commented on GitHub (Jul 8, 2025): Thank you for your report. `CI_` `GITEA_` and `GITHUB_` are reserved prefixes for variables.
Author
Owner

@balporig commented on GitHub (Jul 8, 2025):

@techknowlogick Good to know, should be added to the field placeholder, the current is

case-insensitive, alphanumeric characters or underscores only, cannot start with GITEA_ or GITHUB_
@balporig commented on GitHub (Jul 8, 2025): @techknowlogick Good to know, should be added to the field placeholder, the current is ``` case-insensitive, alphanumeric characters or underscores only, cannot start with GITEA_ or GITHUB_ ```
Author
Owner

@TheFox0x7 commented on GitHub (Jul 8, 2025):

This behavior different from secrets. You can add a secret that starts with CI. See:
4e10adc871/services/secrets/secrets.go (L14-L17)
vs

4e10adc871/services/actions/variables.go (L17-L24)

not sure what's the basis for this rule. And there is a bug with this IMO as regex will catch CItesting and citation.

@TheFox0x7 commented on GitHub (Jul 8, 2025): This behavior different from secrets. You can add a secret that starts with `CI`. See: https://github.com/go-gitea/gitea/blob/4e10adc871363ccd099867563a06a55bb50b296a/services/secrets/secrets.go#L14-L17 vs https://github.com/go-gitea/gitea/blob/4e10adc871363ccd099867563a06a55bb50b296a/services/actions/variables.go#L17-L24 not sure what's the basis for this rule. And there is a bug with this IMO as regex will catch `CItesting` and `citation`.
Author
Owner

@balporig commented on GitHub (Jul 8, 2025):

And there is a bug with this IMO as regex will catch CItesting and citation.

exactly

@balporig commented on GitHub (Jul 8, 2025): > And there is a bug with this IMO as regex will catch CItesting and citation. exactly
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14725