feat: some basic action core logic
This commit is contained in:
parent
a2e2ddb502
commit
c16a870d2b
6 changed files with 64 additions and 0 deletions
3
eng/Containerfile
Normal file
3
eng/Containerfile
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:10.0
|
||||||
|
WORKDIR /work
|
||||||
|
COPY ./src /work
|
||||||
37
src/Geekeey.Build.Pwsh.psd1
Normal file
37
src/Geekeey.Build.Pwsh.psd1
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
@{
|
||||||
|
RootModule = 'Geekeey.Build.Pwsh.psm1'
|
||||||
|
ModuleVersion = '1.0.0'
|
||||||
|
GUID = '234baa68-d26f-4bf9-996d-45ec3520cb95'
|
||||||
|
Author = 'The Geekeey Authors'
|
||||||
|
CompanyName = 'Geekeey'
|
||||||
|
Copyright = '(c) The Geekeey Authors. Licensed under EUPL-1.2.'
|
||||||
|
Description = 'Forgejo Actions helper functions for PowerShell.'
|
||||||
|
FunctionsToExport = @(
|
||||||
|
'Set-ActionOutput',
|
||||||
|
'Set-ActionEnv',
|
||||||
|
'Add-ActionPath',
|
||||||
|
'Add-ActionMask',
|
||||||
|
'Add-ActionMatcher',
|
||||||
|
'Remove-ActionMatcher',
|
||||||
|
'Save-ActionState',
|
||||||
|
'Add-ActionStepSummary',
|
||||||
|
'Get-ActionInput',
|
||||||
|
'Write-ActionDebug',
|
||||||
|
'Write-ActionNotice',
|
||||||
|
'Write-ActionWarning',
|
||||||
|
'Write-ActionError',
|
||||||
|
'Stop-Action',
|
||||||
|
'Invoke-ForgejoApi',
|
||||||
|
'Get-ForgejoContext'
|
||||||
|
)
|
||||||
|
CmdletsToExport = @()
|
||||||
|
VariablesToExport = @()
|
||||||
|
AliasesToExport = @()
|
||||||
|
PowerShellVersion = '7.0'
|
||||||
|
PrivateData = @{
|
||||||
|
PSData = @{
|
||||||
|
LicenseUri = 'https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12'
|
||||||
|
Tags = @('Forgejo', 'Actions', 'CI')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1
src/collection/checkout.ps1
Normal file
1
src/collection/checkout.ps1
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
using module ../Geekeey.Build.Pwsh.psd1
|
||||||
22
src/collection/pwsh.ps1
Normal file
22
src/collection/pwsh.ps1
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
# Copyright (c) The Geekeey Authors
|
||||||
|
# SPDX-License-Identifier: EUPL-1.2
|
||||||
|
using module ../Geekeey.Build.Pwsh.psd1
|
||||||
|
|
||||||
|
Set-StrictMode -Version Latest
|
||||||
|
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
$ProgressPreference = 'Ignore'
|
||||||
|
|
||||||
|
$PSNativeCommandUseErrorActionPreference = $true
|
||||||
|
|
||||||
|
$script = Get-ActionInput -Name "script" -Required
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Invoke-Expression $script
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Write-ActionError "Script failed: $_"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
1
src/collection/ssh-add-key.ps1
Normal file
1
src/collection/ssh-add-key.ps1
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
using module ../Geekeey.Build.Pwsh.psm1
|
||||||
0
src/core/context.ps1
Normal file
0
src/core/context.ps1
Normal file
Loading…
Reference in a new issue