Skip to content

Commit dae49f3

Browse files
committed
20211228A
1 parent 0005803 commit dae49f3

File tree

4 files changed

+245
-34
lines changed

4 files changed

+245
-34
lines changed

.github/workflows/scan-virus.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,41 @@ on:
1414
- "synchronize"
1515
workflow_dispatch:
1616
inputs:
17-
gitdepth:
18-
description: "{boolean} Also scan Git commits."
17+
integrate_git:
18+
description: "{boolean} Git integration."
1919
required: false
2020
default: "true"
2121
jobs:
22-
depth:
23-
name: "Depth Scan"
22+
parse-inputs:
23+
name: "(Parse Inputs)"
2424
runs-on: "ubuntu-latest"
25-
if: "${{github.event.inputs.gitdepth == 'true'}}"
2625
steps:
27-
- name: "Checkout Repository"
28-
uses: "actions/[email protected]"
29-
with:
30-
fetch-depth: 0
31-
- name: "Depth Scan Repository"
32-
uses: "hugoalh/[email protected]"
33-
with:
34-
gitdepth: "true"
35-
flat:
36-
name: "Flat Scan"
26+
- run: |
27+
[string]$GitIntegrationInput = '${{github.event.inputs.integrate_git}}'
28+
if ($GitIntegrationInput.Length -eq 0) {
29+
$GitIntegrationInput = 'false'
30+
}
31+
[bool]$GitIntegration = [bool]::Parse($GitIntegrationInput)
32+
Write-Host -Object "::set-output name=depth::$($GitIntegration ? 0 : 1)"
33+
Write-Host -Object "::set-output name=integrate::$($GitIntegration ? 'git' : 'none')"
34+
Write-Host -Object "::set-output name=title::$($GitIntegration ? 'Depth' : 'Flat')"
35+
id: "parser"
36+
shell: "pwsh"
37+
outputs:
38+
depth: "${{steps.parser.outputs.depth}}"
39+
integrate: "${{steps.parser.outputs.integrate}}"
40+
title: "${{steps.parser.outputs.title}}"
41+
scan-virus:
42+
name: "${{needs.parse-inputs.outputs.title}} Scan"
3743
runs-on: "ubuntu-latest"
38-
if: "${{github.event.inputs.gitdepth != 'true'}}"
44+
needs:
45+
- "parse-inputs"
3946
steps:
4047
- name: "Checkout Repository"
4148
uses: "actions/[email protected]"
42-
- name: "Flat Scan Repository"
43-
uses: "hugoalh/[email protected]"
49+
with:
50+
fetch-depth: "${{needs.parse-inputs.outputs.depth}}"
51+
- name: "${{needs.parse-inputs.outputs.title}} Scan Repository"
52+
uses: "hugoalh/[email protected]"
53+
with:
54+
integrate: "${{needs.parse-inputs.outputs.integrate}}"

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,51 @@ A PowerShell module to create GitHub Actions easier.
2121

2222
## 📚 Documentation
2323

24-
?
24+
*For the official documentation, please visit [GitHub Repository Wiki](https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki).*
25+
26+
### Getting Started
27+
28+
#### Install
29+
30+
PowerShell (>= v7.2.0):
31+
32+
```ps1
33+
Install-Module -Name 'hugoalh.GitHubActionsToolkit'
34+
```
35+
36+
#### Use
37+
38+
```ps1
39+
Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope Local
40+
```
41+
42+
### Function
43+
44+
- `Add-GHActionsEnvironmentVariable`
45+
- `Add-GHActionsPATH`
46+
- `Add-GHActionsSecretMask`
47+
- `Disable-GHActionsCommandEcho`
48+
- `Disable-GHActionsProcessingCommand`
49+
- `Enable-GHActionsCommandEcho`
50+
- `Enable-GHActionsProcessingCommand`
51+
- `Enter-GHActionsLogGroup`
52+
- `Exit-GHActionsLogGroup`
53+
- `Get-GHActionsInput`
54+
- `Get-GHActionsIsDebug`
55+
- `Get-GHActionsState`
56+
- `Get-GHActionsWebhookEventPayload`
57+
- `Invoke-GHActionsScriptGroup`
58+
- `Set-GHActionsOutput`
59+
- `Set-GHActionsState`
60+
- `Write-GHActionsDebug`
61+
- `Write-GHActionsError`
62+
- `Write-GHActionsFail`
63+
- `Write-GHActionsNotice`
64+
- `Write-GHActionsWarning`
65+
66+
### Example
67+
68+
```ps1
69+
Set-GHActionsOutput -Name 'foo' -Value 'bar'
70+
#=> ::set-output name=foo::bar
71+
```

hugoalh.GitHubActionsToolkit.psd1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
'Get-GHActionsInput',
7474
'Get-GHActionsIsDebug',
7575
'Get-GHActionsState',
76+
'Get-GHActionsWebhookEventPayload',
7677
'Invoke-GHActionsScriptGroup',
7778
'Set-GHActionsOutput',
7879
'Set-GHActionsState',

0 commit comments

Comments
 (0)