No description
Find a file
2023-09-05 21:35:31 +02:00
dist chore: remove output 2020-03-21 16:11:51 +01:00
.gitignore feat: project files 2020-03-21 12:41:59 +01:00
action.yml Update action to use NodeJS 16 2022-10-17 09:56:27 +02:00
index.js chore: remove output 2020-03-21 16:11:51 +01:00
LICENSE Initial commit 2020-03-20 22:31:44 +01:00
package.json chore(deps): bump @actions/core from 1.2.3 to 1.2.6 2020-10-01 17:34:13 +00:00
README.md fix: github actions example on the readme 2023-09-05 21:35:31 +02:00
yarn.lock Merge pull request #1 from vimtor/dependabot/npm_and_yarn/lodash-4.17.19 2020-10-31 11:43:22 +01:00

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: vimtor/action-zip@v1.1
        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: vimtor/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