From 84a556cb4e1cd20e940b4fc2bc3920302472d96e Mon Sep 17 00:00:00 2001 From: papeloto Date: Sat, 21 Mar 2020 15:02:44 +0100 Subject: [PATCH] docs: usage and inputs --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- action.yml | 6 +++--- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1171d8a..2ec7e15 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,49 @@ # action-zip -Action for zipping files easily + +> Action for zipping files easily + +## Usage + +The only requirement is to use the official `actions/checkout@v2` first so the zip action has access to the repo files. + +```yaml +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. + +- **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 diff --git a/action.yml b/action.yml index 1c62b91..739efa1 100644 --- a/action.yml +++ b/action.yml @@ -1,15 +1,15 @@ name: "Zip Files" description: "Action for zipping files easily" inputs: - github-token: - description: "GitHub Token" - required: true files: description: "Files or directories to zip" required: true dest: description: "Name of output zip file" default: "result.zip" + recursive: + description: "Whether to add subdirectories to simply zip all files to the root" + default: true runs: using: "node12" main: "dist/index.js"