Skip to content

Commit

Permalink
v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
LasyIsLazy committed Mar 12, 2020
1 parent e3da3be commit 08aaba8
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
45 changes: 45 additions & 0 deletions README.md
@@ -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/github-upload-action@v0.0.1
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. |

2 changes: 1 addition & 1 deletion action.yml
Expand Up @@ -5,7 +5,7 @@ branding:
icon: 'upload'
color: 'white'
inputs:
ACCESS_TOKEN:
access-token:
description: 'Token access to repository'
required: true
file-path:
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -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": "git@github.com:LasyIsLazy/github-upload-action.git",
Expand Down

0 comments on commit 08aaba8

Please sign in to comment.