Git Product home page Git Product logo

action-zip's Introduction

action-zip

Action for zipping files and folders easily

Usage

The only requirement is to use the official actions/checkout@v2 first so the zip action has access to the repo files.

name: Zip Files

on:
  release:
    types: [published]

jobs:
  zip-files:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: papeloto/action-zip@v1
        with:
          files: dist/ manifest.json
          dest: result.zip

In this example, after a release is published, a new file named result.zip will be created with both the file manifest.json and the folder dist (files included).

Inputs

files

Files or directories to zip, relative to GITHUB_WORKSPACE environmental variable.

  • Required: Yes

dest

Name of the output zip file.

  • Required: No
  • Default: result.zip

recursive

Whether to add subdirectories to simply zip all files to the root.

  • Required: No
  • Default: true

If for example, you do the following:

- uses: papeloto/action-zip@v1
  with:
    files: dist/ manifest.json
    recursive: false
    dest: result.zip

All the files inside the dist folder will be added at the root of the zip along with manifest.json. By contrast, if recursive: true (by default), the folder dist is included.

Also if you want a nested file at the root, recursive: false is your guy.

Troubleshooting

If you want to check that the output is the desired one I recommend you to add the following step after zipping. You will be able to download the result.zip file.

- uses: actions/upload-artifact@v1
  with:
    name: my-artifact
    path: ${{ github.workspace }}/result.zip

action-zip's People

Contributors

vimtor avatar dependabot[bot] avatar jgillis avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.