Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .github/.powershell-psscriptanalyzer.psd1

This file was deleted.

1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ updates:
schedule:
interval: weekly
time: "06:00"
target-branch: "develop"
20 changes: 20 additions & 0 deletions .github/workflows/Check-pull-request-source-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check pull request source branch

on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- edited

jobs:
check-branches:
runs-on: ubuntu-latest
steps:
- name: Check branches
run: |
if [ "${{ github.head_ref }}" != "develop" ] && [ "${{ github.base_ref }}" == "main" ]; then
echo "Error: Pull requests to the main branch are only allowed from the develop branch. Please submit your pull request to the develop branch."
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/WAU-ReleaseBuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
wget https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v1.21.13/WAU.zip -UseBasicParsing -OutFile .\WAU.zip

- name: Create release
uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # v1.15.0
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
if: env.ReleaseType != 'No'
with:
tag: v${{ env.NextSemVer }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to main
#push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
pull_request:
branches-ignore:
- main

permissions:
contents: write
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/powershell-tests.yaml

This file was deleted.

17 changes: 8 additions & 9 deletions Sources/Winget-AutoUpdate/functions/Get-WingetCmd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ Function Get-WingetCmd
#default winget path (in user context)
[string]$pu = "$env:LocalAppData\Microsoft\WindowsApps\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\winget.exe";

try
{
#Get Admin Context Winget Location
$WingetInfo = (Get-Item -Path $ps -ErrorAction Stop).VersionInfo | Sort-Object -Property FileVersionRaw -Descending | Select-Object -First 1;
#If multiple versions, pick most recent one
$WingetCmd = $WingetInfo.FileName;
}
catch
#Get Admin Context Winget Location
$WingetInfo = (Get-Item -Path $ps -ErrorAction Stop).VersionInfo | Sort-Object -Property FileVersionRaw -Descending | Select-Object -First 1;
#If multiple versions, pick most recent one
$WingetCmd = $WingetInfo.FileName;

if ([String]::IsNullOrEmpty($WingetCmd))
{
#Get User context Winget Location
if (Test-Path -Path $pu -PathType Leaf)
{
$WingetCmd = $pu;
}
}

return $WingetCmd;
}
}