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
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,32 @@ jobs:
72
72
destination-repository: 'owner/dest-repo'
73
73
```
74
74
75
+
### Pull From Another Repository
76
+
77
+
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.
78
+
79
+
```yaml
80
+
name: Pull from another repository
81
+
on:
82
+
schedule:
83
+
- cron: '0 0 * * *'
84
+
workflow_dispatch:
85
+
jobs:
86
+
push-to-another-repository:
87
+
runs-on: ubuntu-latest
88
+
steps:
89
+
- uses: actions/checkout@v4
90
+
repo: '$owner/$source-another-repo'
91
+
persist-credentials: false
92
+
- name: Push to another repository
93
+
uses: Songmu/action-push-to-another-repository@v2
94
+
with:
95
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
96
+
destination-repository: '$you/$yourepo'
97
+
source-directory: './src'
98
+
destination-directory: 'vendor/another-repo'
99
+
```
100
+
75
101
## How it Works
76
102
1. The action checks out the destination repository
77
103
2. Copies files from the source directory to the destination
@@ -86,7 +112,6 @@ This action requires the following permissions:
86
112
87
113
**Source Repository (where the workflow runs):**
88
114
- `contents: read` - Read files from the source repository
89
-
- `metadata: read` - Access commit history
90
115
91
116
**Destination Repository (where files are pushed):**
92
117
- `contents: write` - Write files and create commits
0 commit comments