You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-12Lines changed: 28 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,21 +28,11 @@ steps:
28
28
29
29
Before using this action, ensure the following requirements are met:
30
30
31
-
1. **Source Repository Checkout**: You must checkout the source repository to ensure the files you want to push are available in the workflow:
32
-
```yaml
33
-
- uses: actions/checkout@v4
34
-
```
31
+
1. **Source Repository Checkout**: You must checkout the source repository to ensure the files you want to push are available in the workflow.
35
32
36
33
2. **Destination Branch**: The destination branch must already exist in the destination repository. If the branch doesn't exist, the action will fail.
37
34
38
-
To create a new branch before using this action, use [`Songmu/action-create-branch`](https://github.com/Songmu/action-create-branch):
39
-
```yaml
40
-
- name: Create branch if needed
41
-
uses: Songmu/action-create-branch@v0
42
-
with:
43
-
repository: 'owner/dest-repo'
44
-
branch: 'new-branch'
45
-
```
35
+
To create a new branch before using this action, use [`Songmu/action-create-branch`](https://github.com/Songmu/action-create-branch).
46
36
47
37
### Permissions
48
38
@@ -110,6 +100,32 @@ jobs:
110
100
run: echo "Successfully pushed changes to the destination repository"
111
101
```
112
102
103
+
### Creating a New Branch
104
+
105
+
```yaml
106
+
name: Push to new branch
107
+
on:
108
+
push:
109
+
branches:
110
+
- main
111
+
jobs:
112
+
push-to-another-repository:
113
+
runs-on: ubuntu-latest
114
+
steps:
115
+
- uses: actions/checkout@v4
116
+
persist-credentials: false
117
+
- name: Create branch if needed
118
+
uses: Songmu/action-create-branch@v0
119
+
with:
120
+
repository: 'owner/dest-repo'
121
+
branch: 'new-feature'
122
+
- name: Push to another repository
123
+
uses: Songmu/action-push-to-another-repository@v2
124
+
with:
125
+
destination-repository: 'owner/dest-repo'
126
+
destination-branch: 'new-feature'
127
+
```
128
+
113
129
### Pull From Another Repository
114
130
115
131
You can also use this action to pull files from another repository and push them to your own repository. This is useful for syncing files or configurations across repositories.
0 commit comments