add GH workflow to keep the cgmanifest up to date.

This commit is contained in:
Travis Plunk
2021-10-20 13:11:22 -07:00
parent 3253124f69
commit 57f4ccd1fc
2 changed files with 222 additions and 44 deletions
+52
View File
@@ -0,0 +1,52 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
name: Update cgmanifest
on:
workflow_dispatch:
schedule:
# At 13:00 UTC every day.
- cron: '0 13 * * *'
defaults:
run:
shell: pwsh
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
jobs:
update-cgmanifest:
name: Update cgmanifest
timeout-minutes: 15
runs-on: windows-latest
if: github.repository == 'PowerShell/PowerShell'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Execute script to update cgmanifest
run: |
Install-Module -Name dotnet.project.assets
- name: Execute script to update cgmanifest
run: |
./tools/findMissingNotices.ps1
- name: Microsoft Teams Notifier
uses: skitionek/notify-microsoft-teams@master
if: failure()
with:
webhook_url: ${{ secrets.PS_BUILD_TEAMS_CHANNEL }}
overwrite: "{title: `Failure in updating cgmanifest. Look at ${workflow_link}`}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
id: cpr
if: env.CREATE_PR == 'true'
with:
commit-message: "Update the cgmanifest with missing or updated components"
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
title: "Update ${{ env.FORMULA_NAME }} formula to version ${{ env.NEW_FORMULA_VERSION }}"
reviewers: travisez13
base: master
draft: false
branch: update-cgmanifest