-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3da3be
commit 08aaba8
Showing
3 changed files
with
47 additions
and
2 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,2 +1,47 @@ | ||
# github-upload-action | ||
Upload files to GitHub repository | ||
|
||
## Usage Example | ||
|
||
```yaml | ||
name: Upload to GitHub | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
upload_job: | ||
runs-on: ubuntu-latest | ||
name: Upload | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
# Setup node first | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
- name: Upload to GitHub | ||
uses: LasyIsLazy/[email protected] | ||
with: | ||
access-token: ${{ secrets.ACCESS_TOKEN }} | ||
file-path: localPath | ||
username: LasyIsLazy | ||
repo: githubRepo | ||
remote-dir: remoteDir | ||
|
||
``` | ||
|
||
## requirements | ||
|
||
1. This action runs on`Node.js`, you must setup `Node.js`, see Usage Example. | ||
2. This action should have access to your GitHub repository. Strongly recommend store it in secrets. [Create a personal access token](https://help.github.com/cn/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) with the `repo` permission. [Create a secret](https://help.github.com/cn/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) named `ACCESS_TOKEN` in your repository and copy access token to the secret value. | ||
|
||
## options | ||
|
||
| key | required | example | description | | ||
| ------------ | -------- | --------------------------- | ------------------------------------------------------------ | | ||
| access-token | ✔ | ${{ secrets.ACCESS_TOKEN }} | Token access to repository. | | ||
| file-path | ✔ | localDir/localPath | Local file path/directory. | | ||
| username | ✔ | LasyIsLazy | GitHub username. | | ||
| repo | ✔ | my-repository | Repository name. | | ||
| remote-dir | | remoteDir/remotePath | Remote repository file path/directory(will be created if not exist). Default: The root of the repository. | | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "github-upload-action", | ||
"version": "v0.0.1-beta.4", | ||
"version": "v0.0.1", | ||
"description": "Upload files to GitHub", | ||
"main": "index.js", | ||
"repository": "[email protected]:LasyIsLazy/github-upload-action.git", | ||
|