Support reusable workflow #34

Merged
wolfogre merged 6 commits from Zettat123/act:fix-reusable-workflow into main 2023-03-29 05:59:23 +00:00
Member

Fix gitea/act_runner#80
Fix gitea/act_runner#85

To support reusable workflows, I made some improvements:

  • read yml files from both .gitea/workflows and .github/workflows
  • clone repository for local reusable workflows because the runner doesn't have the code in its local directory
  • fix the incorrect clone url like https://https://gitea.com
Fix https://gitea.com/gitea/act_runner/issues/80 Fix https://gitea.com/gitea/act_runner/issues/85 To support reusable workflows, I made some improvements: - read `yml` files from both `.gitea/workflows` and `.github/workflows` - clone repository for local reusable workflows because the runner doesn't have the code in its local directory - fix the incorrect clone url like `https://https://gitea.com`
Zettat123 added 1 commit 2023-03-27 10:32:10 +00:00
support local reusable workflow
All checks were successful
check and test
28f766c8ca
lunny reviewed 2023-03-27 12:33:36 +00:00
@ -114,4 +128,3 @@
func newRemoteReusableWorkflow(uses string) *remoteReusableWorkflow {
// GitHub docs:
// https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_iduses
r := regexp.MustCompile(`^([^/]+)/([^/]+)/.github/workflows/([^@]+)@(.*)$`)
Owner

Should we support both?

Should we support both?
Zettat123 added 1 commit 2023-03-28 02:45:10 +00:00
support gitea and github
All checks were successful
check and test
848920306f
Zettat123 changed title from WIP: Support local reusable workflow to Support reusable workflow 2023-03-28 03:17:13 +00:00
Author
Member

Now we use the remoteReusableWorkflow struct in both newLocalReusableWorkflowExecutor and newRemoteReusableWorkflowExecutor. So I think it might be better to rename remoteReusableWorkflow to reusableWorkflow and improve the two functions to simplify the code. But I'm concerned that the refactor might cause more conflicts when we update from upstream.

Now we use the `remoteReusableWorkflow` struct in both `newLocalReusableWorkflowExecutor` and `newRemoteReusableWorkflowExecutor`. So I think it might be better to rename `remoteReusableWorkflow` to `reusableWorkflow` and improve the two functions to simplify the code. But I'm concerned that the refactor might cause more conflicts when we update from upstream.
Zettat123 added 1 commit 2023-03-28 03:41:38 +00:00
fix JobType
All checks were successful
check and test
f8ede23f3e
Owner

Now we use the remoteReusableWorkflow struct in both newLocalReusableWorkflowExecutor and newRemoteReusableWorkflowExecutor. So I think it might be better to rename remoteReusableWorkflow to reusableWorkflow and improve the two functions to simplify the code. But I'm concerned that the refactor might cause more conflicts when we update from upstream.

Please don't do refactor in a soft fork, just add a new function/type and mark the old one deprecated. Or I'll ask you to resolve conflicts when merging upstream. 🌚

> Now we use the `remoteReusableWorkflow` struct in both `newLocalReusableWorkflowExecutor` and `newRemoteReusableWorkflowExecutor`. So I think it might be better to rename `remoteReusableWorkflow` to `reusableWorkflow` and improve the two functions to simplify the code. But I'm concerned that the refactor might cause more conflicts when we update from upstream. Please don't do refactor in a soft fork, just add a new function/type and mark the old one deprecated. Or I'll ask you to resolve conflicts when merging upstream. 🌚
Zettat123 added 1 commit 2023-03-28 04:08:09 +00:00
reduce diff
All checks were successful
check and test
35303173d6
Author
Member

Please don't do refactor in a soft fork

You're right. We should minimize the differences with upstream.

> Please don't do refactor in a soft fork You're right. We should minimize the differences with upstream.
Zettat123 added 1 commit 2023-03-28 04:11:09 +00:00
add comment
All checks were successful
check and test
7290c4cb6e
wolfogre approved these changes 2023-03-29 05:58:21 +00:00
wolfogre added 1 commit 2023-03-29 05:58:30 +00:00
wolfogre merged commit 5e76853b55 into main 2023-03-29 05:59:23 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/act#34
No description provided.