Skip to content

Commit

Permalink
Merge pull request #12 from johnduprey/dev
Browse files Browse the repository at this point in the history
Dev to main
  • Loading branch information
JohnDuprey authored Dec 16, 2022
2 parents 2afa90a + 80a591c commit 80c0ab7
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 48 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/check_and_publish.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/psscriptanalyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Run PSScriptAnalyzer

on:
push:
branches: [main]

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@v1.1
with:
path: .\BitwardenPS
recurse: true
output: results.sarif

- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish New Version

on:
push:
tags: '*'

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: PowerShell script
uses: Amadevus/pwsh-script@v2.0.3
id: Build-Module
with:
script: |
Install-Module ModuleBuilder -Force
Build-Module
- name: Update Metadata
uses: natescherer/update-powershell-metadata-action@v2
with:
path: .\Output\BitwardenPS
version: ${{ github.ref_name }}

- name: Publish PowerShell Module
uses: pcgeek86/publish-powershell-module-action@v20
with:
modulePath: .\Output\BitwardenPS
NuGetApiKey: ${{ secrets.PS_GALLERY_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Output
7 changes: 1 addition & 6 deletions BitwardenPS/Public/Vault API/REST/Start-RestServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,11 @@ function Start-RestServer {
Write-Verbose 'Starting REST server'
$Proc = Start-Process -FilePath $bw.Path -ArgumentList $Arguments -NoNewWindow -PassThru -ErrorAction Stop

$OldProgPref = $global:ProgressPreference
$global:ProgressPreference = 'SilentlyContinue'

do {
$VaultRest = Test-NetConnection -ComputerName $Hostname -Port $Port -InformationLevel Quiet -WarningAction SilentlyContinue
$VaultRest = Test-Connection -TargetName $Hostname -TcpPort $Port
Start-Sleep -Milliseconds 200
} while (-not $VaultRest)

$global:ProgressPreference = $OldProgPref

$script:BwRestServer = [PSCustomObject]@{
PID = $Proc.Id
Port = $Port
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# BitwardenPS Module
[![Downloads]][Gallery] ![Build] ![Publish]

<!-- References -->
[Downloads]: https://img.shields.io/powershellgallery/dt/BitwardenPS
[Gallery]: https://www.powershellgallery.com/packages/BitwardenPS/
[Build]: https://img.shields.io/github/actions/workflow/status/johnduprey/BitwardenPS/psscriptanalyzer.yml?branch=main&label=PSScriptAnalyzer
[Publish]: https://github.com/johnduprey/BitwardenPS/actions/workflows/publish.yml/badge.svg

This module interacts with the Bitwarden Public API and the Vault API.

Expand Down Expand Up @@ -85,3 +92,4 @@ text : @{text=Super secret text; hidden=False}
# Notes

This module is a work in progress. Pull requests are welcome.

0 comments on commit 80c0ab7

Please sign in to comment.