1
0
Fork 0
forgejo/models/actions
Emmanuel BENOÎT 320ab7ed7f
feat(cli): allow updates to runners' secrets
This commit allows the `forgejo-cli actions register` command to change
an existing runner's secret, as discussed in #4610.

It refactors `RegisterRunner` to extract the code that hashes the token,
moving this code to a method called `UpdateSecret` on `ActionRunner`.
A test for the method has been added.

The `RegisterRunner` function is updated so that:
- it relies on `ActionRunner.UpdateSecret` when creating new runners,
- it checks whether an existing runner's secret still matches the one
  passed on the command line,
- it updates the runner's secret if it wasn't created and it no longer
  matches.

A test has been added for the new behaviour.
2024-07-22 11:55:43 +02:00
..
artifact.go
forgejo.go feat(cli): allow updates to runners' secrets 2024-07-22 11:55:43 +02:00
forgejo_test.go feat(cli): allow updates to runners' secrets 2024-07-22 11:55:43 +02:00
main_test.go
run.go
run_job.go
run_job_list.go
run_list.go
runner.go feat(cli): allow updates to runners' secrets 2024-07-22 11:55:43 +02:00
runner_list.go
runner_test.go feat(cli): allow updates to runners' secrets 2024-07-22 11:55:43 +02:00
runner_token.go
runner_token_test.go
schedule.go
schedule_list.go
schedule_spec.go
schedule_spec_list.go
status.go
task.go
task_list.go
task_output.go
task_step.go
tasks_version.go
utils.go
utils_test.go
variable.go