Git Product home page Git Product logo

compress-decompress's Introduction

Compress-Decompress Action

GitHub Super-Linter CI License Latest Tag Top Language

Description

This GitHub Action provides the functionality to compress or decompress files using various compression formats including zip, tar, tgz, and tbz2. It is designed to be easy to use within GitHub workflows for handling file compression and decompression tasks efficiently.

Inputs

Input Description Required
command The operation to perform. It can be either "compress" or "decompress" Yes
source The source directory or file to compress or decompress. Yes
dest The destination directory or file for the output. If not provided, it defaults to the current working directory. No
format The compression format to use. Supported formats are zip, tar, tgz, and tbz2. Yes

Outputs

Output Description
file_path The path to the compressed or decompressed file.

Usage

You can use this action in your GitHub workflow by specifying the action with its required inputs.

Example Workflow

This example demonstrates how to use the Compress-Decompress action to compress a directory:

name: Compress Files

on: [push]

jobs:
  compress-job:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Repository
      uses: actions/checkout@v2

    - name: Compress Directory
      uses: somaz94/compress-decompress@v1
      with:
        command: compress
        source: ./data-folder
        format: zip

    - name: Upload Artifact
      uses: actions/upload-artifact@v4
      with:
        name: compressed-data
        path: ./data-folder.zip

To decompress files, you can modify the workflow like so:

name: Decompress Files

on: [push]

jobs:
  decompress-job:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Repository
      uses: actions/checkout@v4

    - name: Download Artifact
      uses: actions/download-artifact@v4
      with:
        name: compressed-data

    - name: List contents in the workspace
      run: ls -la ${{ github.workspace }}

    - name: Decompress Directory
      uses: somaz94/compress-decompress@v1
      with:
        command: decompress
        source: ./data-folder.zip
        format: zip
        dest: './unpacked'
    
    - name: Display Content of the Unpacked Files
      run: |
        ls -la ${{ github.workspace }}/unpacked
        cat ${{ github.workspace }}/unpacked/data-folder

License

This project is licensed under the MIT License file for details.

compress-decompress's People

Contributors

somaz94 avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 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.