Skip to content

Commit

Permalink
Revert "20231121A"
Browse files Browse the repository at this point in the history
This reverts commit a346bf5.
  • Loading branch information
hugoalh committed Dec 13, 2023
1 parent 26532e7 commit ef9bed9
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish-docker-container-ghp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
org.opencontainers.image.title=Scan Virus (GitHub Action) Image (YARA)
org.opencontainers.image.description=A Docker image for Scan Virus (GitHub Action) to scan Virus.
- name: "Build & Push Docker Image - All"
uses: "docker/build-push-action@v5.1.0"
uses: "docker/build-push-action@v5.0.0"
with:
context: "./"
file: "all.Dockerfile"
Expand All @@ -103,7 +103,7 @@ jobs:
push: "true"
tags: "${{steps.docker-meta-all.outputs.tags}}"
- name: "Build & Push Docker Image - ClamAV"
uses: "docker/build-push-action@v5.1.0"
uses: "docker/build-push-action@v5.0.0"
with:
context: "./"
file: "clamav.Dockerfile"
Expand All @@ -114,7 +114,7 @@ jobs:
push: "true"
tags: "${{steps.docker-meta-clamav.outputs.tags}}"
- name: "Build & Push Docker Image - YARA"
uses: "docker/build-push-action@v5.1.0"
uses: "docker/build-push-action@v5.0.0"
with:
context: "./"
file: "yara.Dockerfile"
Expand Down
1 change: 0 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
> **ℹ️ Notice:**
>
> - The date format is according to ISO 8601 standard.
> - Values in italic format are subject to change.
> - Versions which not in the list are also end of life.
## Report Vulnerability
Expand Down
2 changes: 1 addition & 1 deletion all.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get --assume-yes update
RUN apt-get --assume-yes install powershell
RUN apt-get --assume-yes dist-upgrade
RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"]

# Initialize ClamAV.
COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/
Expand Down
2 changes: 1 addition & 1 deletion all.alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ COPY --from=stage-extract-powershell ${PS_INSTALL_FOLDER}/ ${PS_INSTALL_FOLDER}/
RUN chmod +x $PS_INSTALL_FOLDER/pwsh
RUN ln -s $PS_INSTALL_FOLDER/pwsh /usr/bin/pwsh
RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"]

# Initialize ClamAV.
COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/
Expand Down
2 changes: 1 addition & 1 deletion all.debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get --assume-yes update
RUN apt-get --assume-yes install powershell
RUN apt-get --assume-yes dist-upgrade
RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"]

# Initialize ClamAV.
COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/
Expand Down
2 changes: 1 addition & 1 deletion clamav.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ COPY --from=stage-extract-powershell ${PS_INSTALL_FOLDER}/ ${PS_INSTALL_FOLDER}/
RUN chmod +x $PS_INSTALL_FOLDER/pwsh
RUN ln -s $PS_INSTALL_FOLDER/pwsh /usr/bin/pwsh
RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"]

# Initialize ClamAV.
COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/
Expand Down
2 changes: 1 addition & 1 deletion clamav.alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ COPY --from=stage-extract-powershell ${PS_INSTALL_FOLDER}/ ${PS_INSTALL_FOLDER}/
RUN chmod +x $PS_INSTALL_FOLDER/pwsh
RUN ln -s $PS_INSTALL_FOLDER/pwsh /usr/bin/pwsh
RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"]

# Initialize ClamAV.
COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/
Expand Down
2 changes: 1 addition & 1 deletion clamav.debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get --assume-yes update
RUN apt-get --assume-yes install powershell
RUN apt-get --assume-yes dist-upgrade
RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"]

# Initialize ClamAV.
COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/
Expand Down
7 changes: 5 additions & 2 deletions lib/checkout.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#Requires -PSEdition Core -Version 7.2
$Script:ErrorActionPreference = 'Stop'
Import-Module -Name @(
(Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1')
Import-Module -Name (
@(
'control'
) |
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
) -Scope 'Local'
$SoftwaresVersionTable = [Ordered]@{
'PowerShell' = $PSVersionTable.PSVersion.ToString()
Expand Down
7 changes: 5 additions & 2 deletions lib/clamav.psm1
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#Requires -PSEdition Core -Version 7.2
Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope 'Local'
Import-Module -Name @(
(Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1')
Import-Module -Name (
@(
'control'
) |
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
) -Scope 'Local'
[String[]]$AllowExtensions = @(
'*.cat',
Expand Down
7 changes: 5 additions & 2 deletions lib/git.psm1
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#Requires -PSEdition Core -Version 7.2
Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope 'Local'
Import-Module -Name @(
(Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1')
Import-Module -Name (
@(
'control'
) |
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
) -Scope 'Local'
[Hashtable[]]$GitCommitsProperties = @(
@{ Name = 'AuthorDate'; Placeholder = '%aI'; Transform = {
Expand Down
9 changes: 6 additions & 3 deletions lib/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ If ($Null -ine $InputDebugScript) {
}
Write-Host -Object 'Initialize.'
Set-GitHubActionsOutput -Name 'finish' -Value $False.ToString().ToLower()
Import-Module -Name @(
(Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1'),
(Join-Path -Path $PSScriptRoot -ChildPath 'summary.psm1')
Import-Module -Name (
@(
'control',
'summary'
) |
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
) -Scope 'Local'
[ScanVirusStatistics]$StatisticsTotal = [ScanVirusStatistics]::New()
[Boolean]$InputClamAVEnable = ($ToolHasClamAV -and !$ToolForceClamAV) ? ([Boolean]::Parse((Get-GitHubActionsInput -Name 'clamav_enable' -Mandatory -EmptyStringAsNull))) : $ToolForceClamAV
Expand Down
24 changes: 18 additions & 6 deletions lib/statistics.psm1
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#Requires -PSEdition Core -Version 7.2
Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope 'Local'
Import-Module -Name @(
(Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1'),
(Join-Path -Path $PSScriptRoot -ChildPath 'summary.psm1')
Import-Module -Name (
@(
'control',
'summary'
) |
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
) -Scope 'Local'
Class ScanVirusStatistics {
[String[]]$Issues = @()
Expand Down Expand Up @@ -88,10 +91,19 @@ Class ScanVirusStatistics {
Return $This.GetStatisticsTableString(80)
}
[Void]StatisticsDisplay() {
$DisplayList = [Ordered]@{
Statistics = $This.GetStatisticsTableString()
}
If ($This.Issues.Count -gt 0) {
$DisplayList.("Issues [$($This.Issues.Count)]") = $This.Issues |
Join-String -Separator "`n" -FormatString '- {0}'
}
If ($This.SessionsFound.Count -gt 0) {
$DisplayList.("SessionsFound [$($This.SessionsFound.Count)]") = $This.SessionsFound |
Join-String -Separator ', '
}
Write-GitHubActionsNotice -Message (
[PSCustomObject]@{
Statistics = $This.GetStatisticsTableString()
} |
[PSCustomObject]$DisplayList |
Format-List -Property '*' |
Out-String -Width 120
)
Expand Down
7 changes: 5 additions & 2 deletions lib/yara.psm1
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#Requires -PSEdition Core -Version 7.2
Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope 'Local'
Import-Module -Name @(
(Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1')
Import-Module -Name (
@(
'control'
) |
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
) -Scope 'Local'
[String[]]$AllowExtensions = @(
'*.yar',
Expand Down
2 changes: 1 addition & 1 deletion yara.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get --assume-yes update
RUN apt-get --assume-yes install powershell
RUN apt-get --assume-yes dist-upgrade
RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"]

COPY lib/ ${SCANVIRUS_GHACTION_LIB_ROOT}/
RUN ["pwsh", "-NonInteractive", "/opt/hugoalh/scan-virus-ghaction/lib/checkout.ps1"]
Expand Down
2 changes: 1 addition & 1 deletion yara.alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ COPY --from=stage-extract-powershell ${PS_INSTALL_FOLDER}/ ${PS_INSTALL_FOLDER}/
RUN chmod +x $PS_INSTALL_FOLDER/pwsh
RUN ln -s $PS_INSTALL_FOLDER/pwsh /usr/bin/pwsh
RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"]

COPY lib/ ${SCANVIRUS_GHACTION_LIB_ROOT}/
RUN ["pwsh", "-NonInteractive", "/opt/hugoalh/scan-virus-ghaction/lib/checkout.ps1"]
Expand Down
2 changes: 1 addition & 1 deletion yara.debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get --assume-yes update
RUN apt-get --assume-yes install powershell
RUN apt-get --assume-yes dist-upgrade
RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"]
RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"]

COPY lib/ ${SCANVIRUS_GHACTION_LIB_ROOT}/
RUN ["pwsh", "-NonInteractive", "/opt/hugoalh/scan-virus-ghaction/lib/checkout.ps1"]
Expand Down

0 comments on commit ef9bed9

Please sign in to comment.