12f4ea03a8
refactor: add /v3 suffix to module path for proper Go semver
...
Build and Release / Create Release (push) Successful in 0s
Trigger Vault Plugin Rebuild / Trigger Vault Rebuild (push) Successful in 0s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 2m48s
Build and Release / Lint (push) Failing after 5m2s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (arm64, linux, linux-latest) (push) Has been skipped
Build and Release / Unit Tests (push) Successful in 5m37s
Go's semantic import versioning requires v2+ modules to include the
major version in the module path. This enables using proper version
tags (v3.x.x) instead of pseudo-versions.
Updated module path: code.gitcaddy.com/server/v3
2026-01-17 17:53:59 -05:00
af6d4addd4
code.caddy rename
Build and Release / Create Release (push) Successful in 0s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 3m7s
Build and Release / Lint (push) Successful in 5m21s
Build and Release / Unit Tests (push) Successful in 5m46s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 3m44s
Build and Release / Build Binaries (amd64, darwin, linux-latest) (push) Successful in 4m4s
Build and Release / Build Binaries (arm64, darwin, linux-latest) (push) Successful in 3m23s
Build and Release / Build Binaries (arm64, linux, linux-latest) (push) Successful in 3m47s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 8h6m28s
2026-01-17 09:02:21 -05:00
GitCaddy
ee89fe4960
Fix workflow filter support, AI Learning any option, server stats types, and actions clear buttons
...
- Add workflow filter to clear-cancelled, clear-failed, clear-running, clear-old-success
- Add any option to AI Learning runner type filter
- Fix ServerStats int64 types for FileSize template function
- Add CPULoad field with platform-specific implementations
- Fix actions list template with conditional button visibility
- Use Gitea styled modal dialogs for all clear buttons
🤖 Generated with Claude Code
2026-01-16 00:27:03 +00:00
GitCaddy
6ca11bc207
feat(actions): add Clear Running, workflow filter for disk usage, conditional buttons
...
- Add Clear Running button to delete stuck running workflow runs
- Disk usage now filters by selected workflow
- Clear buttons only appear when corresponding status has runs
- Rename ActionsDiskUsage to DiskUsage (lint fix)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com >
2026-01-15 12:15:52 +00:00
GitCaddy
388ea5264b
feat(actions): add Clear Old Success button with configurable age
...
Adds a button to clear successful workflow runs older than a configurable
number of days (1, 3, 5, 7, 14, or 30 days), defaulting to 5 days.
- Add ClearOldSuccess handler in view.go
- Add DeleteSuccessRunsOlderThan service function
- Add GetSuccessRunIDsOlderThan model function
- Add route /clear-old-success
- Add translations for clear_old_success and clear_old_success_confirm
- Update list.tmpl with dropdown selector and button
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-15 01:43:20 +00:00
GitCaddy
c02e648a3e
feat(actions): add bulk delete and disk usage display for repo admins
...
- Add disk usage statistics endpoint (GET /actions/disk-usage)
- Add Clear Cancelled button to delete all cancelled workflow runs
- Add Clear Failed button to delete all failed workflow runs
- Show disk usage breakdown by status on Actions page sidebar
- Repo admins only feature
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-14 23:07:38 +00:00
Lunny Xiao
0f063214ce
Fix incorrect pull request counter ( #35819 )
...
Fix #35781 , #27472
The PR will not correct the wrong numbers automatically.
There is a cron task `check_repo_stats` which will be run when Gitea
start or midnight. It will correct the numbers.
2025-11-03 20:52:13 +00:00
Zettat123
f939b56cc4
Support Actions concurrency syntax ( #32751 )
...
Fix #24769
Fix #32662
Fix #33260
Depends on https://gitea.com/gitea/act/pulls/124
-
https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency
## ⚠️ BREAKING ⚠️
This PR removes the auto-cancellation feature added by #25716 . Users
need to manually add `concurrency` to workflows to control concurrent
workflows or jobs.
---------
Signed-off-by: Zettat123 <zettat123@gmail.com >
Co-authored-by: Christopher Homberger <christopher.homberger@web.de >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-10-10 18:58:55 +00:00
da Kai
92b843728c
Print PR-Title into tooltip for actions ( #35579 )
...
This PR updates the tooltip for Pull-Request triggered runs to show the
PR title instead of the PR number.
---
I dont remember PR numbers, so having the title in the tooltip makes it
much easier to recognize the right one 😊
Current
<img width="290" height="88" alt="Screenshot 2025-10-03 231547"
src="https://github.com/user-attachments/assets/dd8d264d-933f-4fb1-a945-82b172f95861 "
/>
After
<img width="301" height="91" alt="Screenshot 2025-10-03 224628"
src="https://github.com/user-attachments/assets/74c9809a-c09a-4804-bb27-79058a99238b "
/>
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-10-09 10:01:47 +02:00
Lunny Xiao
8cacee1fbc
Use db.WithTx/WithTx2 instead of TxContext when possible ( #35130 )
2025-07-22 10:02:01 -07:00
ChristopherHX
7cf43e1e85
Add workflow_run api + webhook ( #33964 )
...
Implements
- https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run--code-samples
- https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#get-a-job-for-a-workflow-run--code-samples
- https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository
- https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run
- `/actions/runs` for global + user + org (Gitea only)
- `/actions/jobs` for global + user + org + repository (Gitea only)
- workflow_run webhook + action trigger
- limitations
- workflow id is assigned to a string, this may result into problems in
strongly typed clients
Fixes
- workflow_job webhook url to no longer contain the `runs/<run>` part to
align with api
- workflow instance does now use it's name inside the file instead of
filename if set
Refactoring
- Moved a lot of logic from workflows/workflow_job into a shared module
used by both webhook and api
TODO
- [x] Verify Keda Compatibility
- [x] Edit Webhook API bug is resolved
Closes https://github.com/go-gitea/gitea/issues/23670
Closes https://github.com/go-gitea/gitea/issues/23796
Closes https://github.com/go-gitea/gitea/issues/24898
Replaces https://github.com/go-gitea/gitea/pull/28047 and is much more
complete
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-06-20 20:14:00 +08:00
NorthRealm
e25c0caa7a
Add endpoint deleting workflow run ( #34337 )
...
Add endpoint deleting workflow run
Resolves #26219
/claim #26219
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-05-13 19:18:13 +00:00
Lunny Xiao
e5101ce3df
Only git operations should update last changed of a repository ( #34388 )
...
Try to fix #32046
2025-05-11 19:18:46 +00:00
TheFox0x7
aece12cb17
Enable addtional linters ( #34085 )
...
enable mirror, usestdlibbars and perfsprint
part of: https://github.com/go-gitea/gitea/issues/34083
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-04-01 10:14:01 +00:00
ChristopherHX
4ead1466fd
Fix auto concurrency cancellation skips commit status updates ( #33764 )
...
* add missing commit status
* conflicts with concurrency support
Closes #33763
Co-authored-by: Giteabot <teabot@gitea.io >
2025-03-10 15:58:48 -07:00
wxiaoguang
9cb56e8207
Refactor RefName ( #33234 )
...
And fix some FIXMEs
2025-01-13 14:01:53 +08:00
yp05327
4cc01a2189
Update status check for all supported on.pull_request.types in Gitea ( #33117 )
...
Thanks @Zettat123
Follow #33116
Fix #33051
on.pull_request.types doc:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
on.pull_request.types added in this PR:
```
assigned, unassigned, review_requested, review_request_removed, milestoned, demilestoned, labeled, unlabeled
```
unsupported types in Gitea:
```
// Unsupported activity types:
// converted_to_draft, ready_for_review, locked, unlocked, auto_merge_enabled, auto_merge_disabled, enqueued, dequeued
```
TODO:
- [x] add test
2025-01-08 01:58:47 +08:00
wxiaoguang
bf8ec00a2c
Refactor "string truncate" ( #32984 )
2024-12-26 11:56:03 +08:00
Lunny Xiao
5e6d3b834d
Detect whether action view branch was deleted ( #32764 )
...
Fix #32761

2024-12-12 19:28:23 +00:00
Lunny Xiao
45a08f6680
Trim title before insert/update to database to match the size requirements of database ( #32498 )
...
Fix #32489
2024-11-14 07:19:14 +00:00
FuXiaoHei
9e3f28abee
Show latest run when visit /run/latest ( #31808 )
...
Proposal from
https://github.com/go-gitea/gitea/issues/27911#issuecomment-2271982172
When visit latest run path, such as
`/{user}/{repo}/actions/runs/latest`. It renders latest run instead of
index=0 currently.
2024-08-10 08:40:41 +08:00
silverwind
f613758348
Update misspell to 0.5.1 and add misspellings.csv ( #30573 )
...
Misspell 0.5.0 supports passing a csv file to extend the list of
misspellings, so I added some common ones from the codebase. There is at
least one typo in a API response so we need to decided whether to revert
that and then likely remove the dict entry.
2024-04-27 08:03:49 +00:00
yp05327
26ddd28b3a
Improve job commit description ( #30579 )
...
Fix https://github.com/go-gitea/gitea/issues/30567
When job is a schedule:

When it is a normal one:

also add a 'space' behind `:`


---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2024-04-26 02:22:45 +00:00
sillyguodong
37fddfa453
Interpolate runs-on with variables when scheduling tasks ( #30640 )
...
Follow #29468
1. Interpolate runs-on with variables when scheduling tasks.
2. The `GetVariablesOfRun` function will check if the `Repo` of the run
is nil.
---------
Co-authored-by: Giteabot <teabot@gitea.io >
2024-04-23 20:55:25 +02:00
Jason Song
dcb5a1a9e7
Cancel previous runs of the same PR automatically ( #29961 )
...
Follow #25716 . Also cancel previous runs for `pull_request_sync`.
It's not a bug since it original PR said "if the event is push".
The main change is
https://github.com/go-gitea/gitea/pull/29961/files#diff-08adda3f8ae0360937f46abb1f4418603bd3518522baa356be11c6c7ac4abcc3 .
And also rename `CancelRunningJobs` to `CancelPreviousJobs` to make it
more clear.
2024-03-21 15:01:35 +08:00
Nanguan Lin
74b4e8dc4f
Implement actions badge svgs ( #28102 )
...
replace #27187
close #23688
The badge has two parts: label(workflow name) and message(action
status). 5 colors are provided with 7 statuses.
Color mapping:
```go
var statusColorMap = map[actions_model.Status]string{
actions_model.StatusSuccess: "#4c1", // Green
actions_model.StatusSkipped: "#dfb317", // Yellow
actions_model.StatusUnknown: "#97ca00", // Light Green
actions_model.StatusFailure: "#e05d44", // Red
actions_model.StatusCancelled: "#fe7d37", // Orange
actions_model.StatusWaiting: "#dfb317", // Yellow
actions_model.StatusRunning: "#dfb317", // Yellow
actions_model.StatusBlocked: "#dfb317", // Yellow
}
```
preview:





---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: Giteabot <teabot@gitea.io >
Co-authored-by: delvh <dev.lh@web.de >
2024-02-27 18:56:18 +01:00
yp05327
8c59b9c561
Fix incorrect action duration time when rerun the job before executed once ( #28364 )
...
Fix #28323
Reason was mentioned here:
https://github.com/go-gitea/gitea/issues/28323#issuecomment-1841867298
### Changes: (maybe breaking)
We can rerun jobs in Gitea, so there will be some problems in
calculating duration time.
In this PR, I use the exist `Started` and `Stopped` column to record the
last run time instead of the total time,
and add a new `PreviousDuration` column to record the previous duration
time.
You can also check the cost time of last run:

2024-01-19 14:05:49 +00:00
Lunny Xiao
442b9329aa
Fix schedule tasks bugs ( #28691 )
...
Fix #28157
This PR fix the possible bugs about actions schedule.
## The Changes
- Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to
service layer
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when actions unit has been disabled
or global disabled.
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when default branch changed.
2024-01-12 21:50:38 +00:00
Lunny Xiao
d455445979
Use db.Find instead of writing methods for every object ( #28084 )
...
For those simple objects, it's unnecessary to write the find and count
methods again and again.
2023-11-24 03:49:41 +00:00
Lunny Xiao
1a337db2a9
Add a new column schedule_id for action_run to track ( #26975 )
...
Fix #26971
And the UI now will display it's scheduled but not triggered by a push.
<img width="954" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/d211845c-457e-4c3e-af1f-a0d654d3f365 ">
2023-09-08 23:01:19 +08:00
CaiCandong
f46859a6cb
Replace util.SliceXxx with slices.Xxx ( #26958 )
2023-09-07 09:37:47 +00:00
Jason Song
dccba073b6
Add optimistic lock to ActionRun table ( #26563 )
...
Should fix #26559 .
How xorm works: https://xorm.io/docs/chapter-06/1.lock/
---------
Co-authored-by: Giteabot <teabot@gitea.io >
2023-08-21 14:07:52 +00:00
Bo-Yi Wu
1eb5855550
Implement auto-cancellation of concurrent jobs if the event is push ( #25716 )
...
- cancel running jobs if the event is push
- Add a new function `CancelRunningJobs` to cancel all running jobs of a
run
- Update `FindRunOptions` struct to include `Ref` field and update its
condition in `toConds` function
- Implement auto cancellation of running jobs in the same workflow in
`notify` function
related task: https://github.com/go-gitea/gitea/pull/22751/
---------
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com >
Signed-off-by: appleboy <appleboy.tw@gmail.com >
Co-authored-by: Jason Song <i@wolfogre.com >
Co-authored-by: delvh <dev.lh@web.de >
2023-07-25 11:15:55 +08:00
sillyguodong
991139268d
Reduce unnecessary DB queries for Actions tasks ( #25199 )
...
Close #24544
Changes:
- Create `action_tasks_version` table to store the latest version of
each scope (global, org and repo).
- When a job with the status of `waiting` is created, the tasks version
of the scopes it belongs to will increase.
- When the status of a job already in the database is updated to
`waiting`, the tasks version of the scopes it belongs to will increase.
- On Gitea side, in `FeatchTask()`, will try to query the
`action_tasks_version` record of the scope of the runner that call
`FetchTask()`. If the record does not exist, will insert a row. Then,
Gitea will compare the version passed from runner to Gitea with the
version in database, if inconsistent, try pick task. Gitea always
returns the latest version from database to the runner.
Related:
- Protocol: https://gitea.com/gitea/actions-proto-def/pulls/10
- Runner: https://gitea.com/gitea/act_runner/pulls/219
2023-07-24 06:11:27 +00:00
Zettat123
fae9c9e59d
Support pull_request_target event ( #25229 )
...
Fix #25088
This PR adds the support for
[`pull_request_target`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target )
workflow trigger. `pull_request_target` is similar to `pull_request`,
but the workflow triggered by the `pull_request_target` event runs in
the context of the base branch of the pull request rather than the head
branch. Since the workflow from the base is considered trusted, it can
access the secrets and doesn't need approvals to run.
2023-06-26 14:33:18 +08:00
Lunny Xiao
f56a4d8d6d
Use the type RefName for all the needed places and fix pull mirror sync bugs ( #24634 )
...
This PR replaces all string refName as a type `git.RefName` to make the
code more maintainable.
Fix #15367
Replaces #23070
It also fixed a bug that tags are not sync because `git remote --prune
origin` will not remove local tags if remote removed.
We in fact should use `git fetch --prune --tags origin` but not `git
remote update origin` to do the sync.
Some answer from ChatGPT as ref.
> If the git fetch --prune --tags command is not working as expected,
there could be a few reasons why. Here are a few things to check:
>
>Make sure that you have the latest version of Git installed on your
system. You can check the version by running git --version in your
terminal. If you have an outdated version, try updating Git and see if
that resolves the issue.
>
>Check that your Git repository is properly configured to track the
remote repository's tags. You can check this by running git config
--get-all remote.origin.fetch and verifying that it includes
+refs/tags/*:refs/tags/*. If it does not, you can add it by running git
config --add remote.origin.fetch "+refs/tags/*:refs/tags/*".
>
>Verify that the tags you are trying to prune actually exist on the
remote repository. You can do this by running git ls-remote --tags
origin to list all the tags on the remote repository.
>
>Check if any local tags have been created that match the names of tags
on the remote repository. If so, these local tags may be preventing the
git fetch --prune --tags command from working properly. You can delete
local tags using the git tag -d command.
---------
Co-authored-by: delvh <dev.lh@web.de >
2023-05-26 01:04:48 +00:00
Jason Song
6644446c3f
Treat PRs with agit flow as fork PRs when triggering actions. ( #23884 )
...
There is no fork concept in agit flow, anyone with read permission can
push `refs/for/<target-branch>/<topic-branch>` to the repo. So we should
treat it as a fork pull request because it may be from an untrusted
user.
2023-04-06 16:57:30 -04:00
Jason Song
d1f75ef452
Fix checks for needs in Actions ( #23789 )
...
Fix:
- https://gitea.com/gitea/act_runner/issues/77
- https://gitea.com/gitea/act_runner/issues/81
Before:
<img width="1489" alt="image"
src="https://user-images.githubusercontent.com/9418365/228501567-f752cf87-a7ed-42c6-8f3d-ba741795c1fe.png ">
Highlights:
- Upgrade act to make things doable, related to
- https://gitea.com/gitea/act/pulls/32
- https://gitea.com/gitea/act/pulls/33
- https://gitea.com/gitea/act/pulls/35
- Make `needs` works
- Sort jobs in the original order in the workflow files
2023-03-30 22:33:17 +08:00
sillyguodong
678957602f
Create commit status when event is pull_request_sync ( #23683 )
...
Fix : #23674
If the type of `hook_event` is `pull_request_sync`, also need to insert
a record of `commit_status` into DB.
Because `pull_request` event and `pull_request_sync` event have the same
payload, so the code is reusable.
Screenshot:

2023-03-24 16:05:48 -04:00
sillyguodong
806861ce27
Fix missing commit status in PR which from forked repo ( #23351 )
...
close : #23347
### Reference and Inference
According to Github REST API
[doc](https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#list-commit-statuses-for-a-reference ):
1. The `Drone CI` that can create some commit status by
[API](https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status )
is enabled in `go-gitea/gitea`. So I tried to call the API to get a
commit status list of a PR which is commited to upstream
repo(`go-gitea/gitea`). As a result, the API returned a array of commit
status.

2. Then I tried to call the API to get commit status list of the
reference which of the `SHA` is the same as step 1 in the repo which is
forked from `go-gitea/gitea`. But I got a empty array.

So, I believe it that:
1. The commit status is not shared between upstream repo and forked
repo.
2. The coomit status is bound to a repo that performs actions. (Gitea's
logic is the same)
### Cause
During debugging, I found it that commit status are not stored in the DB
as expected.
So, I located the following code:
a4099f1e69/services/actions/commit_status.go (L18-L26)
When I create a PR, the type of `event` is `pull request`, not `push`.
So the code return function directly.
### Screenshot



### Other
In this PR, I also fix the problem of missing icon which represents
running in PRs list.


2023-03-13 16:05:19 -05:00
Jason Song
26ef328c25
Avoid too long names for actions ( #23162 )
...
The name of the job or step comes from the workflow file, while the name
of the runner comes from its registration. If the strings used for these
names are too long, they could cause db issues.
2023-02-28 18:20:36 +08:00
Jason Song
7eed06b733
Require approval to run actions for fork pull request ( #22803 )
...
Currently, Gitea will run actions automatically which are triggered by
fork pull request. It's a security risk, people can create a PR and
modify the workflow yamls to execute a malicious script.
So we should require approval for first-time contributors, which is the
default strategy of a public repo on GitHub, see [Approving workflow
runs from public
forks](https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks ).
Current strategy:
- don't need approval if it's not a fork PR;
- always need approval if the user is restricted;
- don't need approval if the user can write;
- don't need approval if the user has been approved before;
- otherwise, need approval.
https://user-images.githubusercontent.com/9418365/217207121-badf50a8-826c-4425-bef1-d82d1979bc81.mov
GitHub has an option for that, you can see that at
`/<owner>/<repo>/settings/actions`, and we can support that later.
<img width="835" alt="image"
src="https://user-images.githubusercontent.com/9418365/217199990-2967e68b-e693-4e59-8186-ab33a1314a16.png ">
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2023-02-24 15:58:49 +08:00
Jason Song
1cd40992a7
Fix ref to trigger Actions ( #22679 )
...
If triggered by PR, the ref should be `pull/<index>/head` instead of
`repo.DefaultBranch`.
And improve UI:
<img width="493" alt="image"
src="https://user-images.githubusercontent.com/9418365/215731280-312564f2-2450-45d0-b986-1accb0670976.png ">
Related to #21937 .
2023-01-31 22:45:25 +00:00
Jason Song
922de198c2
Implement actions ( #21937 )
...
Close #13539 .
Co-authored by: @lunny @appleboy @fuxiaohei and others.
Related projects:
- https://gitea.com/gitea/actions-proto-def
- https://gitea.com/gitea/actions-proto-go
- https://gitea.com/gitea/act
- https://gitea.com/gitea/act_runner
### Summary
The target of this PR is to bring a basic implementation of "Actions",
an internal CI/CD system of Gitea. That means even though it has been
merged, the state of the feature is **EXPERIMENTAL**, and please note
that:
- It is disabled by default;
- It shouldn't be used in a production environment currently;
- It shouldn't be used in a public Gitea instance currently;
- Breaking changes may be made before it's stable.
**Please comment on #13539 if you have any different product design
ideas**, all decisions reached there will be adopted here. But in this
PR, we don't talk about **naming, feature-creep or alternatives**.
### ⚠️ Breaking
`gitea-actions` will become a reserved user name. If a user with the
name already exists in the database, it is recommended to rename it.
### Some important reviews
- What is `DEFAULT_ACTIONS_URL` in `app.ini` for?
- https://github.com/go-gitea/gitea/pull/21937#discussion_r1055954954
- Why the api for runners is not under the normal `/api/v1` prefix?
- https://github.com/go-gitea/gitea/pull/21937#discussion_r1061173592
- Why DBFS?
- https://github.com/go-gitea/gitea/pull/21937#discussion_r1061301178
- Why ignore events triggered by `gitea-actions` bot?
- https://github.com/go-gitea/gitea/pull/21937#discussion_r1063254103
- Why there's no permission control for actions?
- https://github.com/go-gitea/gitea/pull/21937#discussion_r1090229868
### What it looks like
<details>
#### Manage runners
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205870657-c72f590e-2e08-4cd4-be7f-2e0abb299bbf.png ">
#### List runs
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205872794-50fde990-2b45-48c1-a178-908e4ec5b627.png ">
#### View logs
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205872501-9b7b9000-9542-4991-8f55-18ccdada77c3.png ">
</details>
### How to try it
<details>
#### 1. Start Gitea
Clone this branch and [install from
source](https://docs.gitea.io/en-us/install-from-source ).
Add additional configurations in `app.ini` to enable Actions:
```ini
[actions]
ENABLED = true
```
Start it.
If all is well, you'll see the management page of runners:
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205877365-8e30a780-9b10-4154-b3e8-ee6c3cb35a59.png ">
#### 2. Start runner
Clone the [act_runner](https://gitea.com/gitea/act_runner ), and follow
the
[README](https://gitea.com/gitea/act_runner/src/branch/main/README.md )
to start it.
If all is well, you'll see a new runner has been added:
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205878000-216f5937-e696-470d-b66c-8473987d91c3.png ">
#### 3. Enable actions for a repo
Create a new repo or open an existing one, check the `Actions` checkbox
in settings and submit.
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205879705-53e09208-73c0-4b3e-a123-2dcf9aba4b9c.png ">
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205879383-23f3d08f-1a85-41dd-a8b3-54e2ee6453e8.png ">
If all is well, you'll see a new tab "Actions":
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205881648-a8072d8c-5803-4d76-b8a8-9b2fb49516c1.png ">
#### 4. Upload workflow files
Upload some workflow files to `.gitea/workflows/xxx.yaml`, you can
follow the [quickstart](https://docs.github.com/en/actions/quickstart )
of GitHub Actions. Yes, Gitea Actions is compatible with GitHub Actions
in most cases, you can use the same demo:
```yaml
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
```
If all is well, you'll see a new run in `Actions` tab:
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205884473-79a874bc-171b-4aaf-acd5-0241a45c3b53.png ">
#### 5. Check the logs of jobs
Click a run and you'll see the logs:
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205884800-994b0374-67f7-48ff-be9a-4c53f3141547.png ">
#### 6. Go on
You can try more examples in [the
documents](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions )
of GitHub Actions, then you might find a lot of bugs.
Come on, PRs are welcome.
</details>
See also: [Feature Preview: Gitea
Actions](https://blog.gitea.io/2022/12/feature-preview-gitea-actions/ )
---------
Co-authored-by: a1012112796 <1012112796@qq.com >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: ChristopherHX <christopher.homberger@web.de >
Co-authored-by: John Olheiser <john.olheiser@gmail.com >
2023-01-31 09:45:19 +08:00