-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(API): add route and implementation for creating/updating repository secret #26766
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GiteaBot
added
the
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
label
Aug 28, 2023
pull-request-size
bot
added
the
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
label
Aug 28, 2023
lunny
approved these changes
Aug 28, 2023
GiteaBot
added
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
and removed
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
labels
Aug 28, 2023
wxiaoguang
reviewed
Aug 29, 2023
…ecret - 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>
- Add a new function `CreateOrUpdateSecret` in `models/secret/secret.go` - Fix a typo in the function name `CreateOrUpdateOrgSecret` to `CreateOrUpdateSecret` in `routers/api/v1/repo/action.go` Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Modify the function `CreateOrUpdateOrgSecret` in `routers/api/v1/org/action.go` - Replace the call to `secret_model.UpdateSecret` with `secret_model.CreateOrUpdateSecret` - Remove the block of code that handles the case when the secret is not found - Remove the call to `secret_model.InsertEncryptedSecret` - Add a new variable `isCreated` to check if the secret was created or updated - Update the error handling for the function `CreateOrUpdateOrgSecret` - Modify the function `CreateOrUpdateSecret` in `routers/api/v1/repo/action.go` - Replace the call to `secret_model.UpdateSecret` with `secret_model.CreateOrUpdateSecret` - Remove the block of code that handles the case when the secret is not found - Remove the call to `secret_model.InsertEncryptedSecret` - Add a new variable `isCreated` to check if the secret was created or updated - Update the error handling for the function `CreateOrUpdateSecret` Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Change the `CreateOrUpdateOrgSecret` function name to `CreateOrUpdateSecret` in `routers/api/v1/api.go` - Change the `CreateOrUpdateOrgSecret` function name to `CreateOrUpdateSecret` in `routers/api/v1/org/action.go` Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
wxiaoguang
approved these changes
Aug 29, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the CreateOrUpdateSecret
api handler could also be simplified to a shared function (including: check name, call CreateOrUpdateSecret, make response), it also could be done later.
GiteaBot
added
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
and removed
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
labels
Aug 29, 2023
lunny
added
the
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
label
Aug 29, 2023
lets roll 💯 |
GiteaBot
removed
the
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
label
Aug 29, 2023
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Aug 30, 2023
* giteaofficial/main: Use `Set[Type]` instead of `map[Type]bool/struct{}`. (go-gitea#26804) Fix verifyCommits error when push a new branch (go-gitea#26664) Fix Uint8Array comparisons and update vitest (go-gitea#26805) Add various missing files-changed dependencies (go-gitea#26799) Improve flex list item padding (go-gitea#26779) Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (go-gitea#26759) feat(API): add route and implementation for creating/updating repository secret (go-gitea#26766) Replace deprecated `elliptic.Marshal` (go-gitea#26800) Updating the js libraries to latest version. (go-gitea#26795) Fix some slice append usages (go-gitea#26778) Use Go 1.21 for golangci-lint (go-gitea#26786) Fix notification circle (border-radius) (go-gitea#26794) Fix context filter has no effect in dashboard (go-gitea#26695) Add default label in branch select list (go-gitea#26697) Remove redundant nil check in `WalkGitLog` (go-gitea#26773) Remove fomantic `item` module (go-gitea#26775) Update info regarding internet connection for build (go-gitea#26776) Fix being unable to use a repo that prohibits accepting PRs as a PR source. (go-gitea#26785)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
modifies/api
This PR adds API routes or modifies them
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
spec: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret
routers/api/v1/repo/action.go
with the implementation of theCreateOrUpdateSecret
functionupdateRepoSecret
operation in thev1_json.tmpl
template file