-
Notifications
You must be signed in to change notification settings - Fork 106
60 lines (51 loc) · 1.78 KB
/
whats-new-automation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: "generate what's new article"
on:
schedule:
- cron: "0 2 1 * *" # The first of every month at 2 AM
workflow_dispatch:
inputs:
reason:
description: "The reason for running the workflow"
required: true
default: "Manual run"
permissions:
contents: read
jobs:
create-what-is-new:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: "Print manual run reason"
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "Reason: ${{ github.event.inputs.reason }}"
- name: Azure OpenID Connect
id: azure-oidc-auth
uses: dotnet/docs-tools/.github/actions/oidc-auth-flow@main
with:
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
audience: ${{ secrets.OSMP_API_AUDIENCE }}
- uses: dotnet/docs-tools/WhatsNew.Cli@main
env:
GitHubKey: ${{ secrets.GITHUB_TOKEN }}
AZURE_ACCESS_TOKEN: ${{ steps.azure-oidc-auth.outputs.access-token }}
with:
owner: dotnet
repo: docs-aspire
savedir: './docs/whats-new'
- name: create-pull-request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
with:
branch: create-whatsnew-pull-request/patch
title: "What's new article"
commit-message: 'Bot 🤖 generated "What''s new article"'
body: "Automated creation of What's new article."