You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models
sillyguodong 35a653d7ed
Support configuration variables on Gitea Actions (#24724)
Co-Author: @silverwind @wxiaoguang 
Replace: #24404

See:
- [defining configuration variables for multiple
workflows](https://docs.github.com/en/actions/learn-github-actions/variables#defining-configuration-variables-for-multiple-workflows)
- [vars
context](https://docs.github.com/en/actions/learn-github-actions/contexts#vars-context)

Related to:
- [x] protocol: https://gitea.com/gitea/actions-proto-def/pulls/7
- [x] act_runner: https://gitea.com/gitea/act_runner/pulls/157
- [x] act: https://gitea.com/gitea/act/pulls/43

#### Screenshoot
Create Variable:

![image](https://user-images.githubusercontent.com/33891828/236758288-032b7f64-44e7-48ea-b07d-de8b8b0e3729.png)


![image](https://user-images.githubusercontent.com/33891828/236758174-5203f64c-1d0e-4737-a5b0-62061dee86f8.png)

Workflow:
```yaml
  test_vars:
    runs-on: ubuntu-latest
    steps:
      - name: Print Custom Variables
        run: echo "${{ vars.test_key }}"
      - name: Try to print a non-exist var
        run: echo "${{ vars.NON_EXIST_VAR }}"
```

Actions Log:

![image](https://user-images.githubusercontent.com/33891828/236759075-af0c5950-368d-4758-a8ac-47a96e43b6e2.png)

---
This PR just implement the org / user (depends on the owner of the
current repository) and repo level variables, The Environment level
variables have not been implemented.
Because
[Environment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#about-environments)
is a module separate from `Actions`. Maybe it would be better to create
a new PR to do it.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2 years ago
..
actions Support configuration variables on Gitea Actions (#24724) 2 years ago
activities Use a separate admin page to show global stats, remove `actions` stat (#25062) 2 years ago
admin Make repo migration cancelable and fix various bugs (#24605) 2 years ago
asymkey Merge setting.InitXXX into one function with options (#24389) 2 years ago
auth Add ability to set multiple redirect URIs in OAuth application UI (#25072) 2 years ago
avatars Avoid warning for system setting when start up (#23054) 2 years ago
db Fix index generation parallelly failure (#25235) 2 years ago
dbfs Merge setting.InitXXX into one function with options (#24389) 2 years ago
fixtures Fix duplicate Reviewed-by trailers (#24796) 2 years ago
git Fix index generation parallelly failure (#25235) 2 years ago
issues Refactor: TotalTimest return seconds (#25370) 2 years ago
migrations Support configuration variables on Gitea Actions (#24724) 2 years ago
organization Use RepositoryList instead of []*Repository (#25074) 2 years ago
packages Hide limited users if viewed by anonymous ghost (#25214) 2 years ago
perm Rewrite logger system (#24726) 2 years ago
project Improve GetBoards and getDefaultBoard (#22981) 2 years ago
pull refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo Remove stars when repo goes private (#19904) 2 years ago
secret Support configuration variables on Gitea Actions (#24724) 2 years ago
shared/types Display owner of a runner as a tooltip instead of static text (#24377) 2 years ago
system Avoid warning for system setting when start up (#23054) 2 years ago
unit Rewrite logger system (#24726) 2 years ago
unittest Test query must have "order by" explicitly to avoid unstable results (#24963) 2 years ago
user Show `bot` label next to username when rendering autor link if the user is a bot (#24943) 2 years ago
webhook New webhook trigger for receiving Pull Request review requests (#24481) 2 years ago
error.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_generation.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Merge setting.InitXXX into one function with options (#24389) 2 years ago
migrate.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
migrate_test.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
org.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
org_team.go Remove org users who belong to no teams (#24247) 2 years ago
org_team_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
org_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Implement actions artifacts (#22738) 2 years ago
repo_collaboration.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo_collaboration_test.go Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 2 years ago
repo_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_transfer.go Fix unclear `IsRepositoryExist` logic (#24374) 2 years ago
repo_transfer_test.go Rename almost all Ctx functions (#22071) 2 years ago