Skip to content

Commit

Permalink
initial revision
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco authored Mar 11, 2024
1 parent a956b55 commit bf4e669
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release New Action Version
on:
push:
branches:
- "main"

jobs:
release-action:
name: Release new version
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Bump Version
uses: patriotsoftware/semver-bump-action@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea
35 changes: 35 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Windows Extract from Zip'
author: DevOps
description: Windows Extract file/folder from zip

inputs:
zip-path:
description: 'Helm Namespace'
required: true
extract-path:
description: 'Path to file/folder to extract relative to zip'
required: true
destination-path:
description: 'Destination path'
required: false
default: '.\'

runs:
using: 'composite'
steps:
- name: Extract file/folder
shell: powershell
run: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
$zip = [System.IO.Compression.ZipFile]::OpenRead("${{ inputs.zip-path }}")
$zip.Entries | Where-Object { $_.FullName -like "${{ inputs.extract-path }}/*" } |
ForEach-Object {
$root = Join-Path ${{ inputs.destination-path }} $_.FullName
if (-not (Test-Path $(Split-Path -Path $root -Parent))) {
New-Item $(Split-Path -Path $root -Parent) -Type Directory -Force | Out-Null
}
if (-not $_.FullName.EndsWith("/")) {
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $root, $true)
}
}
$zip.Dispose()

0 comments on commit bf4e669

Please sign in to comment.