Skip to content

generate what's new article #60

generate what's new article

generate what's new article #60

Workflow file for this run

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"
jobs:
create-what-is-new:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- uses: actions/[email protected]
- name: "Print manual run reason"
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "Reason: ${{ github.event.inputs.reason }}"
- name: Azure OpenID Connect
uses: azure/login@v2
with:
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
audience: ${{ secrets.OSMP_API_AUDIENCE }}
allow-no-subscriptions: true
- name: OSMP API access
run: |
TOKEN=$(az account get-access-token --query 'accessToken' -o tsv --resource ${{ secrets.OSMP_API_AUDIENCE }})
echo "AZURE_ACCESS_TOKEN=$TOKEN" >> $GITHUB_ENV
- uses: dotnet/docs-tools/WhatsNew.Cli@main
env:
GitHubKey: ${{ secrets.GITHUB_TOKEN }}
AZURE_ACCESS_TOKEN: ${{ env.AZURE_ACCESS_TOKEN }}
with:
owner: dotnet
repo: docs
savedir: './docs/whats-new'
- name: create-pull-request
uses: peter-evans/create-pull-request@9153d834b60caba6d51c9b9510b087acf9f33f83
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."