]> source.dussan.org Git - gitea.git/commit
Refactor commit status for Actions jobs (#23786)
authorJason Song <i@wolfogre.com>
Wed, 29 Mar 2023 15:27:37 +0000 (23:27 +0800)
committerGitHub <noreply@github.com>
Wed, 29 Mar 2023 15:27:37 +0000 (11:27 -0400)
commit3e8db31a5b5a7be731b19da4bd666b0ddc35bd31
tree0c51783184dcb015fda3ca03c611bd3d9476349c
parente57e1144c5ae7a2995e6818c6ae32139e563add7
Refactor commit status for Actions jobs (#23786)

Before:
<img width="353" alt="xnip_230329_163852"
src="https://user-images.githubusercontent.com/9418365/228479807-424452df-10fa-45cf-ae4b-09939c0ed54c.png">
After:
<img width="508" alt="xnip_230329_163358"
src="https://user-images.githubusercontent.com/9418365/228479923-537b54fe-9564-4105-a068-bcc75fa2a7ea.png">

Highlights:
- Treat `StatusSkipped` as `CommitStatusSuccess` instead of
`CommitStatusFailure`, so it fixed #23599.
- Use the bot user `gitea-actions` instead of the trigger as the creator
of commit status.
- New format `<run_name> / <job_name> / (<event>)` for the context of
commit status to avoid conflicts.
- Add descriptions for commit status.
- Add the missing calls to `CreateCommitStatus`.
- Refactor `CreateCommitStatus` to make it easier to use.
routers/api/actions/runner/runner.go
routers/api/actions/runner/utils.go
routers/web/repo/actions/view.go
services/actions/clear_tasks.go
services/actions/commit_status.go
services/actions/job_emitter.go
services/actions/notifier_helper.go