aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/action.go
Commit message (Collapse)AuthorAgeFilesLines
* enable staticcheck QFxxxx rules (#34064)TheFox0x73 days1-2/+2
|
* Added Description Field for Secrets and Variables (#33526)John Smith2025-03-171-11/+16
| | | | | | | Fixes #33484 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor error system (#33626)wxiaoguang2025-02-171-17/+17
|
* Refactor error system (#33610)wxiaoguang2025-02-161-54/+54
|
* Artifacts download api for artifact actions v4 (#33510)ChristopherHX2025-02-161-0/+391
| | | | | | | | | | | | | | | | | | | | | | | | | | * download endpoint has to use 302 redirect * fake blob download used if direct download not possible * downloading v3 artifacts not possible New repo apis based on GitHub Rest V3 - GET /runs/{run}/artifacts (Cannot use run index of url due to not being unique) - GET /artifacts - GET + DELETE /artifacts/{artifact_id} - GET /artifacts/{artifact_id}/zip - (GET /artifacts/{artifact_id}/zip/raw this is a workaround for a http 302 assertion in actions/toolkit) - api docs removed this is protected by a signed url like the internal artifacts api and no longer usable with any token or swagger - returns http 401 if the signature is invalid - or change the artifact id - or expired after 1 hour Closes #33353 Closes #32124 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Enhance routers for the Actions variable operations (#33547)Jason Song2025-02-111-1/+5
| | | | | | | | | | - Find the variable before updating or deleting - Move the main logic from `routers/web/repo/setting/variables.go` to `routers/web/shared/actions/variables.go`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Feature: Support workflow event dispatch via API (#33545)wxiaoguang2025-02-111-0/+270
| | | | | | | | | Fix: https://github.com/go-gitea/gitea/issues/31765 (Re-open #32059) --------- Co-authored-by: Bence Santha <git@santha.eu> Co-authored-by: Bence Sántha <7604637+bencurio@users.noreply.github.com> Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
* Revert "Feature: Support workflow event dispatch via API (#32059)" (#33541)wxiaoguang2025-02-101-297/+0
| | | This reverts commit 523751dc82bbb9d3f8d413f232e23ab0476eb4d4.
* Feature: Support workflow event dispatch via API (#32059)Bence Sántha2025-02-101-0/+297
| | | | | | | | | ref: https://github.com/go-gitea/gitea/issues/31765 --------- Signed-off-by: Bence Santha <git@santha.eu> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
* Set owner id to zero when GetRegistrationToken for repo (#31725)Jason Song2024-07-291-1/+1
| | | | | | | | | Fix #31707. It's split from #31724. Although #31724 could also fix #31707, it has change a lot so it's not a good idea to backport it.
* fix(api): owner ID should be zero when created repo secret (#31715)Bo-Yi Wu2024-07-291-4/+2
| | | | | | | | | - Change condition to include `RepoID` equal to 0 for organization secrets --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Fix API endpoint for registration-token (#31722)Jason Song2024-07-291-1/+1
| | | Partially fix #31707. Related to #30656
* Refactor names (#31405)wxiaoguang2024-06-191-7/+7
| | | | | | | This PR only does "renaming": * `Route` should be `Router` (and chi router is also called "router") * `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`) * Use lower case for private functions to avoid exposing or abusing
* refactor: merge ListActionTasks func to action.go file (#30811)Bo-Yi Wu2024-05-021-0/+66
| | | | | Just merge actions.go file to action.go Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* feat(api): enhance Actions Secrets Management API for repository (#30656)Bo-Yi Wu2024-04-261-7/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | - Add endpoint to list repository action secrets in API routes - Implement `ListActionsSecrets` function to retrieve action secrets from the database - Update Swagger documentation to include the new `/repos/{owner}/{repo}/actions/secrets` endpoint - Add `actions` package import and define new routes for actions, secrets, variables, and runners in `api.go`. - Refactor action-related API functions into `Action` struct methods in `org/action.go` and `repo/action.go`. - Remove `actionAPI` struct and related functions, replacing them with `NewAction()` calls. - Rename `variables.go` to `action.go` in `org` directory. - Delete `runners.go` and `secrets.go` in both `org` and `repo` directories, consolidating their content into `action.go`. - Update copyright year and add new imports in `org/action.go`. - Implement `API` interface in `services/actions/interface.go` for action-related methods. - Remove individual action-related functions and replace them with methods on the `Action` struct in `repo/action.go`. --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Signed-off-by: appleboy <appleboy.tw@gmail.com>
* Add API for `Variables` (#29520)sillyguodong2024-03-281-0/+296
| | | | | | | close #27801 --------- Co-authored-by: silverwind <me@silverwind.io>
* Move context from modules to services (#29440)Lunny Xiao2024-02-271-1/+1
| | | | | | | | | | | | | | | Since `modules/context` has to depend on `models` and many other packages, it should be moved from `modules/context` to `services/context` according to design principles. There is no logic code change on this PR, only move packages. - Move `code.gitea.io/gitea/modules/context` to `code.gitea.io/gitea/services/context` - Move `code.gitea.io/gitea/modules/contexttest` to `code.gitea.io/gitea/services/contexttest` because of depending on context - Move `code.gitea.io/gitea/modules/upload` to `code.gitea.io/gitea/services/context/upload` because of depending on context
* Refactor secrets modification logic (#26873)KN4CK3R2023-09-051-30/+30
| | | | - Share code between web and api - Add some tests
* feat(API): add secret deletion functionality for repository (#26808)Bo-Yi Wu2023-09-011-0/+54
| | | | | | | | | | | | | | | - Modify the `CreateOrUpdateSecret` function in `api.go` to include a `Delete` operation for the secret - Modify the `DeleteOrgSecret` function in `action.go` to include a `DeleteSecret` operation for the organization - Modify the `DeleteSecret` function in `action.go` to include a `DeleteSecret` operation for the repository - Modify the `v1_json.tmpl` template file to update the `operationId` and `summary` for the `deleteSecret` operation in both the organization and repository sections --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* feat(API): add route and implementation for creating/updating repository ↵Bo-Yi Wu2023-08-291-0/+75
secret (#26766) spec: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret - Add a new route for creating or updating a secret value in a repository - Create a new file `routers/api/v1/repo/action.go` with the implementation of the `CreateOrUpdateSecret` function - Update the Swagger documentation for the `updateRepoSecret` operation in the `v1_json.tmpl` template file --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>