-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df0902f
commit 794177a
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Validate issue | ||
|
||
on: | ||
issues: | ||
types: [edited] | ||
|
||
jobs: | ||
validation: | ||
if: ${{ github.event.issue.state == 'open' }} | ||
runs-on: windows-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Install needed packages | ||
uses: crazy-max/[email protected] | ||
with: | ||
args: install trid 7zip.portable -y --no-progress | ||
- name: Validate Issue | ||
run: | | ||
Import-Module "${{ github.workspace }}\scripts\edit.psm1" | ||
Exclude-package -title ${{ github.event.issue.title }} -issueNumber ${{ github.event.issue.number }} -repository "${{ github.event.repository.full_name }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<# | ||
.SYNOPSIS | ||
Updates nuspec file description from README.md | ||
.DESCRIPTION | ||
This script should be called in au_AfterUpdate to put the text in the README.md | ||
into description tag of the Nuspec file. The current description will be replaced. | ||
Function will throw an error if README.md is not found. | ||
.PARAMETER SkipFirst | ||
Number of start lines to skip from the README.md, by default 0. | ||
.PARAMETER SkipLast | ||
Number of end lines to skip from the README.md, by default 0. | ||
.EXAMPLE | ||
function global:au_AfterUpdate { Set-DescriptionFromReadme -SkipFirst 2 } | ||
#> | ||
function Exclude-Package { | ||
param( | ||
[Parameter(Mandatory = $true, ParameterSetName = "issue")] | ||
[long]$issueNumber, | ||
[Parameter(Mandatory = $true)] | ||
[string]$title | ||
) | ||
Write-Host "number : $issueNumber" | ||
Write-Host "Title : $title" | ||
$extract = $($title.split('(|)')[1]) | ||
Write-Host "Extract : $extract" | ||
$folder = Join-Path $PSScriptRoot "../automatic/$extract" | ||
Write-Host "Test : $(Test-Path -Path $folder)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Export all the extensions that are meant to be used | ||
# within a au update script here. | ||
|
||
# We just specify the functions we want to export | ||
# but the file containing the functions is expected | ||
# to be named using the same name. | ||
$funcs = @( | ||
'New-GithubIssue' | ||
'Exclude-package' | ||
) | ||
|
||
$funcs | % { | ||
if (Test-Path "$PSScriptRoot\$_.ps1") { | ||
. "$PSScriptRoot\$_.ps1" | ||
if (Get-Command $_ -ea 0) { | ||
Export-ModuleMember -Function $_ | ||
} | ||
} | ||
} |