From a49921bb1baeba134f75bccd7127fe8e442b9ee3 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Sat, 15 Oct 2022 15:37:39 +0330 Subject: [PATCH 1/3] add github variable helpers (credit: @microsoft) --- scripts/utils.ps1 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index 117f274..ca22479 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -67,6 +67,31 @@ function Digest-Hash($path) { return Invoke-Expression "md5sum $path" } +function Set-GHVariable { + param( + [Parameter(Mandatory = $true)] + [string]$Name, + [Parameter(Mandatory = $true)] + [string]$Value + ) + + Write-Verbose "Setting CI variable $Name to $Value" -Verbose + + if ($env:GITHUB_ENV) { + "$Name=$Value" | Out-File $env:GITHUB_ENV -Append + } +} + +function Get-GHTempPath { + $temp = [System.IO.Path]::GetTempPath() + if ($env:RUNNER_TEMP) { + $temp = $env:RUNNER_TEMP + } + + Write-Verbose "Get CI Temp path: $temp" -Verbose + return $temp +} + function Get-VersionStr() { # Clear existing variable if ($string) { Clear-Variable -name string } From 1c4a8b3ff541917b1ba9056edabd6a9ac0b96c49 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Sat, 15 Oct 2022 15:39:57 +0330 Subject: [PATCH 2/3] add vendor dependency check action --- .github/workflows/vendor.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/vendor.yml diff --git a/.github/workflows/vendor.yml b/.github/workflows/vendor.yml new file mode 100644 index 0000000..3beb8f5 --- /dev/null +++ b/.github/workflows/vendor.yml @@ -0,0 +1,39 @@ +name: Update Vendor + +on: + schedule: + # At 13:37 UTC every day. + - cron: '37 13 * * *' + +defaults: + run: + shell: pwsh + +permissions: + contents: read + +jobs: + vendor: + + runs-on: windows-latest + continue-on-error: false + timeout-minutes: 15 + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - run: | + # TODO + + - uses: peter-evans/create-pull-request@v4 + with: + title: 'Actions: Updates to the vendored dependencies' + body: 'Automatic changes' + commit-message: 'Update vendored dependencies' + branch: update-vendor + base: master From 59269aa9f13a47bacaf5996b063f131bc3b7307e Mon Sep 17 00:00:00 2001 From: David Refoua Date: Sat, 15 Oct 2022 15:48:13 +0330 Subject: [PATCH 3/3] allow manual trigger --- .github/workflows/vendor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/vendor.yml b/.github/workflows/vendor.yml index 3beb8f5..190c278 100644 --- a/.github/workflows/vendor.yml +++ b/.github/workflows/vendor.yml @@ -1,6 +1,7 @@ name: Update Vendor on: + workflow_dispatch: schedule: # At 13:37 UTC every day. - cron: '37 13 * * *'