Modified so this could be deployed to github marketplace

Signed-off-by: Eliminater74 <eliminater74@gmail.com>
This commit is contained in:
Michael Ryan 2021-06-12 01:50:16 -04:00 committed by Eliminater74
parent 520a9d8c28
commit f87dd89716
No known key found for this signature in database
GPG Key ID: 2DB13AFD9AF1A53C
2 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# github-action-push-to-another-repository # github-action-push-to-another-repository-directory
When to use this GitHub Action? It is useful in case that you have a GitHub repository with a a directory that you want to push to another GitHub repository using GitHub Actions (automated on push, for example). It is also useful if using GitHub Actions you generate certain files that you want to push to another GitHub repository. When to use this GitHub Action? It is useful in case that you have a GitHub repository with a a directory that you want to push to another GitHub repository using GitHub Actions (automated on push, for example). It is also useful if using GitHub Actions you generate certain files that you want to push to another GitHub repository.
@ -6,7 +6,7 @@ Flow:
The [example repository](https://github.com/cpina/push-to-another-repository-example) has a MarkDown file [main.md](https://github.com/cpina/push-to-another-repository-example/blob/main/main.md)), during the [GitHub Actions flow](https://github.com/cpina/push-to-another-repository-example/blob/main/.github/workflows/ci.yml#L19) it executes [build.sh](https://github.com/cpina/push-to-another-repository-example/blob/main/build.sh) and the output/ directory (configurable via [source-directory](https://github.com/cpina/push-to-another-repository-example/blob/main/.github/workflows/ci.yml#L27) appears in the [output repository](https://github.com/cpina/push-to-another-repository-output). The [example repository](https://github.com/cpina/push-to-another-repository-example) has a MarkDown file [main.md](https://github.com/cpina/push-to-another-repository-example/blob/main/main.md)), during the [GitHub Actions flow](https://github.com/cpina/push-to-another-repository-example/blob/main/.github/workflows/ci.yml#L19) it executes [build.sh](https://github.com/cpina/push-to-another-repository-example/blob/main/build.sh) and the output/ directory (configurable via [source-directory](https://github.com/cpina/push-to-another-repository-example/blob/main/.github/workflows/ci.yml#L27) appears in the [output repository](https://github.com/cpina/push-to-another-repository-output).
Please bear in mind: files in the target repository are deleted. This is to make sure that it contains only the generated files in the last run without previously generated files. Please bear in mind: files in the target repository's specified directory are deleted. This is to make sure that it contains only the generated files in the last run without previously generated files.
There are different variables to setup the behaviour: There are different variables to setup the behaviour:
@ -37,6 +37,9 @@ The branch name for the destination repository. It defaults to `main` for histor
### `commit-message` (argument) [optional] ### `commit-message` (argument) [optional]
The commit message to be used in the output repository. Optional and defaults to "Update from $REPOSITORY_URL@commit". The commit message to be used in the output repository. Optional and defaults to "Update from $REPOSITORY_URL@commit".
### `target-branch` (argument) [optional]
The directory to wipe and replace in the target repository. Defaults to wiping the entire repository
The string `ORIGIN_COMMIT` is replaced by `$REPOSITORY_URL@commit`. The string `ORIGIN_COMMIT` is replaced by `$REPOSITORY_URL@commit`.
### `API_TOKEN_GITHUB` (environment) ### `API_TOKEN_GITHUB` (environment)

View File

@ -1,4 +1,4 @@
name: 'Push directory to another repository' name: 'Push directory to another repository directory'
description: 'Useful to push files to another repository to be used, for example, via github pages' description: 'Useful to push files to another repository to be used, for example, via github pages'
inputs: inputs:
source-directory: source-directory: