Skip to content

Commit ae4d948

Browse files
committed
update auto pr
1 parent b0bbd33 commit ae4d948

17 files changed

+128
-500
lines changed

.github/workflows/ci.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
test_powershell:
10+
name: WindowsPowerShell
11+
runs-on: windows-latest
12+
steps:
13+
- name: Checkout Bucket
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 2
17+
path: 'my_bucket'
18+
- name: Checkout Scoop
19+
uses: actions/checkout@v2
20+
with:
21+
repository: ScoopInstaller/Scoop
22+
path: 'scoop_core'
23+
- name: Init and Test
24+
shell: powershell
25+
run: |
26+
$env:SCOOP_HOME="$(Resolve-Path '.\scoop_core')"
27+
.\scoop_core\test\bin\init.ps1
28+
.\my_bucket\bin\test.ps1
29+
test_pwsh:
30+
name: PowerShell
31+
runs-on: windows-latest
32+
steps:
33+
- name: Checkout Bucket
34+
uses: actions/checkout@v2
35+
with:
36+
fetch-depth: 2
37+
path: 'my_bucket'
38+
- name: Checkout Scoop
39+
uses: actions/checkout@v2
40+
with:
41+
repository: ScoopInstaller/Scoop
42+
path: 'scoop_core'
43+
- name: Init and Test
44+
shell: pwsh
45+
run: |
46+
$env:SCOOP_HOME="$(Resolve-Path '.\scoop_core')"
47+
.\scoop_core\test\bin\init.ps1
48+
.\my_bucket\bin\test.ps1

.github/workflows/issue_comment.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ on:
44
name: Commented Pull Request
55
jobs:
66
pullRequestHandler:
7-
name: Pull Request Validator
8-
runs-on: ubuntu-latest
7+
name: PullRequestHandler
8+
runs-on: windows-latest
99
steps:
1010
- uses: actions/checkout@main
11-
- name: Pull Request Validation
12-
uses: Ash258/Scoop-GithubActions@stable
11+
- name: PullRequestHandler
12+
uses: ScoopInstaller/GithubActions@main
1313
if: startsWith(github.event.comment.body, '/verify')
1414
env:
15-
GITH_EMAIL: [email protected]
1615
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/issues.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on:
2+
issues:
3+
types: [ opened, labeled ]
4+
name: Issues
5+
jobs:
6+
issueHandler:
7+
name: IssueHandler
8+
runs-on: windows-latest
9+
steps:
10+
- uses: actions/checkout@main
11+
- name: IssueHandler
12+
uses: ScoopInstaller/GithubActions@main
13+
if: github.event.action == 'opened' || (github.event.action == 'labeled' && contains(github.event.issue.labels.*.name, 'verify'))
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pull_request.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ on:
44
name: Pull Requests
55
jobs:
66
pullRequestHandler:
7-
name: Pull Request Validator
8-
runs-on: ubuntu-latest
7+
name: PullRequestHandler
8+
runs-on: windows-latest
99
steps:
1010
- uses: actions/checkout@main
11-
- name: Pull Request Validation
12-
uses: Ash258/Scoop-GithubActions@stable
11+
- name: PullRequestHandler
12+
uses: ScoopInstaller/GithubActions@main
1313
env:
14-
GITH_EMAIL: [email protected]
1514
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/schedule.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
on:
2+
workflow_dispatch:
23
schedule:
3-
- cron: '0 * * * *'
4+
# run every 4 hours
5+
- cron: '20 */4 * * *'
46
name: Excavator
57
jobs:
68
excavate:
7-
name: Excavator
8-
runs-on: ubuntu-latest
9+
name: Excavate
10+
runs-on: windows-latest
911
steps:
1012
- uses: actions/checkout@main
1113
- name: Excavate
12-
uses: Ash258/Scoop-GithubActions@stable
14+
uses: ScoopInstaller/GithubActions@main
1315
env:
1416
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1517
SKIP_UPDATED: '1'

.markdownlint.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"MD013": false,
3+
"MD024": {
4+
"siblings_only": true
5+
}
6+
}

.vscode/settings.json

+20-51
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,26 @@
1+
// Configure PSScriptAnalyzer settings
12
{
3+
"[powershell]": {
4+
"editor.formatOnSave": true
5+
},
6+
"powershell.scriptAnalysis.settingsPath": "PSScriptAnalyzerSettings.psd1",
7+
"powershell.codeFormatting.preset": "OTBS",
8+
"powershell.codeFormatting.alignPropertyValuePairs": true,
9+
"powershell.codeFormatting.ignoreOneLineBlock": true,
210
"json.schemas": [
311
{
4-
"url": "https://raw.githubusercontent.com/lukesampson/scoop/master/schema.json",
12+
"url": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
513
"fileMatch": [
6-
".vscode/Template.jsonc",
7-
"bucket/*.json",
8-
],
9-
},
10-
],
11-
"powershell.codeFormatting.preset": "OTBS",
12-
"terminals.terminals": [
13-
{
14-
"name": "Powershell",
15-
"shellPath": "powershell.exe",
16-
"shellArgs": [
17-
"-NoLogo",
18-
"-NoExit",
19-
],
20-
"focus": true,
21-
"open": true,
22-
},
23-
{
24-
"name": "Powershell Core",
25-
"shellPath": "pwsh.exe",
26-
"shellArgs": [
27-
"-NoLogo",
28-
"-NoExit",
29-
],
30-
"focus": true,
31-
"open": true,
32-
},
33-
{
34-
"name": "Powershell Core (Preview)",
35-
"shellPath": "pwsh-preview.exe",
36-
"shellArgs": [
37-
"-NoLogo",
38-
"-NoExit",
39-
],
40-
"focus": true,
41-
"open": true,
42-
},
14+
"bucket/*.json"
15+
]
16+
}
4317
],
44-
"yaml.format.bracketSpacing": true,
45-
"yaml.format.enable": true,
46-
"yaml.format.singleQuote": true,
47-
"yaml.validate": true,
48-
"yaml.schemas": {
49-
"https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/appveyor.json": "appveyor.yml",
50-
"https://raw.githubusercontent.com/lukesampson/scoop/master/schema.json": [
51-
"bucket/*.yml",
52-
],
53-
"https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json": [
54-
".github/workflows/*",
55-
],
56-
},
18+
"files.exclude": {
19+
"**/.git": true,
20+
"**/.svn": true,
21+
"**/.hg": true,
22+
"**/CVS": true,
23+
"**/.DS_Store": true,
24+
"**/tmp": true
25+
}
5726
}

bin/Helpers.ps1

-9
This file was deleted.

bin/auto-pr.ps1

+6-46
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,9 @@
1-
<#
2-
.SYNOPSIS
3-
Updates manifests and pushes them or creates pull-requests.
4-
.DESCRIPTION
5-
Updates manifests and pushes them to directly the master branch or creates pull-requests for upstream.
6-
.PARAMETER Manifest
7-
Specify manifest to be updated.
8-
.PARAMETER Dir
9-
Specify directory with manifests.
10-
.PARAMETER Upstream
11-
Specify upstream repository with target branch.
12-
.PARAMETER Push
13-
Specify if updates should be directly pushed to 'origin master'.
14-
.PARAMETER Request
15-
Specify if pull-requests should be created on 'upstream master' for each manifest.
16-
.PARAMETER SpecialSnowflakes
17-
Specify list of manifests, which should be force updated.
18-
#>
191
param(
20-
[Alias('App', 'Name')]
21-
[String] $Manifest = '*',
22-
[ValidateScript( { if ( Test-Path $_ -Type Container) { $true } else { $false } })]
23-
[String] $Dir = "$PSScriptRoot\..\bucket",
24-
[ValidatePattern('^(.+)\/(.+):(.+)$')]
25-
[String] $Upstream = $((git config --get remote.origin.url) -replace '^.+[:/](?<user>.*)\/(?<repo>.*)(\.git)?$', '${user}/${repo}:master'),
26-
[Switch] $Push,
27-
[Switch] $Request,
28-
[string[]] $SpecialSnowflakes
2+
# overwrite upstream param
3+
[String]$upstream = "<username>/<bucketname>:main"
294
)
305

31-
begin {
32-
if (-not $env:SCOOP_HOME) {
33-
if (-not (Get-Command 'scoop' -ErrorAction SilentlyContinue)) { throw 'Scoop installation or SCOOP_HOME environment is required' }
34-
$env:SCOOP_HOME = scoop prefix scoop | Resolve-Path
35-
}
36-
$Params = @{
37-
App = $Manifest
38-
Dir = Resolve-Path $Dir
39-
Upstream = $Upstream
40-
Push = $Push
41-
Request = $Request
42-
SpecialSnowflakes = $SpecialSnowflakes
43-
SkipUpdated = $true
44-
}
45-
}
46-
47-
process { & "$env:SCOOP_HOME\bin\auto-pr.ps1" @Params }
48-
49-
end { Write-Host 'DONE' -ForegroundColor Yellow }
6+
if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) }
7+
$autopr = "$env:SCOOP_HOME/bin/auto-pr.ps1"
8+
$dir = "$PSScriptRoot/../bucket" # checks the parent dir
9+
Invoke-Expression -command "& '$autopr' -dir '$dir' -upstream $upstream $($args | ForEach-Object { "$_ " })"

bin/checkAndPush.ps1

-77
This file was deleted.

0 commit comments

Comments
 (0)