forked from cpina/github-action-push-to-another-repository
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modify to keep files in the destination repository
- Loading branch information
Showing
3 changed files
with
30 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# github-action-push-to-another-repository | ||
|
||
Used to push generated files from a directory from Git Action step into another repository on Github. By design it deletes the files from the destination directory as it is meant to "publish" a set generated files. | ||
Used to push generated files from a directory from Git Action step into another repository on Github. | ||
|
||
E.g. | ||
Repository pandoc-test contains Markdown and a Git Action to generate, using Pandoc, an output: HTML, PDF, odt, epub, etc. | ||
|
@@ -10,22 +10,23 @@ Repository pandoc-test-output: contains only the generated files from the first | |
And pandoc-test-output can have Git Pages to give access to the files (or just links to the raw version of the files) | ||
|
||
## Inputs | ||
### `source-directory` (argument) | ||
From the repository that this Git Action is executed the directory that contains the files to be pushed into the repository. | ||
### `source-files` (argument) | ||
From the repository that this Git Action is executed the files to be pushed into the repository. This argument supports multiple space-separated filenames and globbing. | ||
|
||
### `destination-directory` (argument) [optional] | ||
The directory in the destination repository to copy the source files into. | ||
|
||
### `destination-github-username` (argument) | ||
For the repository `https://github.com/cpina/push-to-another-repository-output` is `cpina`. It's also used for the `Author:` in the generated git messages. | ||
For the repository `https://github.com/nkoppel/push-to-another-repository-output` is `nkoppel`. It's also used for the `Author:` in the generated git messages. | ||
|
||
### `destination-repository-name` (argument) | ||
For the repository `https://github.com/cpina/push-to-another-repository-output` is `push-to-another-repository-output` | ||
|
||
*Warning:* this Github Action currently deletes all the files and directories in the destination repository. The idea is to copy from an `output` directory into the `destination-repository-name` having a copy without any previous files there. | ||
For the repository `https://github.com/nkoppel/push-to-another-repository-output` is `push-to-another-repository-output` | ||
|
||
### `user-email` (argument) | ||
The email that will be used for the commit in the destination-repository-name. | ||
|
||
### `destination-repository-username` (argument) [optional] | ||
The Username/Organization for the destination repository, if different from `destination-github-username`. For the repository `https://github.com/cpina/push-to-another-repository-output` is `cpina`. | ||
The Username/Organization for the destination repository, if different from `destination-github-username`. For the repository `https://github.com/nkoppel/push-to-another-repository-output` is `nkoppel`. | ||
|
||
### `target-branch` (argument) [optional] | ||
The branch name for the destination repository, if different from `master`. | ||
|
@@ -53,22 +54,12 @@ Then make the token available to the Github Action following the steps: | |
## Example usage | ||
```yaml | ||
- name: Pushes to another repository | ||
uses: cpina/github-action-push-to-another-repository@master | ||
uses: nkoppel/push-files-to-another-repository@master | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | ||
with: | ||
source-directory: 'output' | ||
destination-github-username: 'cpina' | ||
source-files: 'output/*' | ||
destination-github-username: 'nkoppel' | ||
destination-repository-name: 'pandoc-test-output' | ||
user-email: [email protected] | ||
user-email: [email protected] | ||
``` | ||
Working example: | ||
https://github.com/cpina/push-to-another-repository-example/blob/master/.github/workflows/ci.yml | ||
It generates files from: | ||
https://github.com/cpina/push-to-another-repository-example | ||
To: | ||
https://github.com/cpina/push-to-another-repository-output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters