Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
upload

GitHub Action

Upload to GitHub

v0.0.2-beta.0 Pre-release

Upload to GitHub

upload

Upload to GitHub

Upload file to your GitHub repository with Node.js

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Upload to GitHub

uses: LasyIsLazy/github-upload-action@v0.0.2-beta.0

Learn more about this action in LasyIsLazy/github-upload-action

Choose a version

github-upload-action

Upload files to GitHub repository

Usage Example

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 onNode.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 with the repo permission. Create a secret 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.