Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Unpack tgz Files

Unpack tgz Files #1

Workflow file for this run

name: Unpack Tar Files
on:
push:
paths:
- '*.tar'
pull_request:
paths:
- '*.tar'
workflow_dispatch: # Allow manual triggering of the workflow
jobs:
unpack:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Create /src directory if it doesn't exist
run: mkdir -p src
- name: List tar files
run: |
echo "Listing tar files in root directory:"
ls *.tar || echo "No tar files found"
- name: Extract tar files
run: |
for tarfile in *.tar; do
if [ -f "$tarfile" ]; then
dirname=$(basename "$tarfile" .tar)
mkdir -p "src/$dirname"
tar -xf "$tarfile" -C "src/$dirname"
echo "Unpacked $tarfile into src/$dirname"
fi
done