2021-06-26 03:21:28 +08:00
|
|
|
# This is a basic workflow to help you get started with Actions
|
|
|
|
|
|
|
|
name: 'generate what''s new article'
|
|
|
|
|
|
|
|
# Controls when the action will run.
|
|
|
|
on:
|
|
|
|
# Triggers the workflow on push or pull request events but only for the default branch
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 1 * *' # The first of every month
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
reason:
|
|
|
|
description: 'The reason for running the workflow'
|
|
|
|
required: true
|
|
|
|
default: 'Manual run'
|
|
|
|
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
|
|
jobs:
|
|
|
|
# This workflow contains a single job called "create-what-is-new"
|
|
|
|
create-what-is-new:
|
|
|
|
# The type of runner that the job will run on
|
|
|
|
runs-on: ubuntu-latest
|
2021-12-02 07:48:51 +08:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
2024-05-02 00:09:21 +08:00
|
|
|
id-token: write
|
2024-04-29 22:34:39 +08:00
|
|
|
if: ${{ github.repository_owner == 'dotnet' }}
|
2021-06-26 03:21:28 +08:00
|
|
|
|
|
|
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
|
|
steps:
|
2023-02-25 04:06:07 +08:00
|
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
2021-06-26 03:21:28 +08:00
|
|
|
|
2023-02-25 04:06:07 +08:00
|
|
|
- name: "Print manual run reason"
|
2024-04-18 19:40:09 +08:00
|
|
|
if: github.event_name == 'workflow_dispatch'
|
2021-06-26 03:21:28 +08:00
|
|
|
run: |
|
2021-12-02 07:48:51 +08:00
|
|
|
echo "Reason: ${{ github.event.inputs.reason }}"
|
2021-06-26 03:21:28 +08:00
|
|
|
|
2024-05-02 00:09:21 +08:00
|
|
|
- name: Azure OpenID Connect
|
2024-05-04 02:02:10 +08:00
|
|
|
id: azure-oidc-auth
|
|
|
|
uses: dotnet/docs-tools/.github/actions/oidc-auth-flow@main
|
2024-05-02 00:09:21 +08:00
|
|
|
with:
|
|
|
|
client-id: ${{ secrets.CLIENT_ID }}
|
|
|
|
tenant-id: ${{ secrets.TENANT_ID }}
|
|
|
|
audience: ${{ secrets.OSMP_API_AUDIENCE }}
|
|
|
|
|
2023-02-25 04:06:07 +08:00
|
|
|
- uses: dotnet/docs-tools/WhatsNew.Cli@main
|
2021-06-26 03:21:28 +08:00
|
|
|
env:
|
|
|
|
GitHubKey: ${{ secrets.GITHUB_TOKEN }}
|
2024-05-04 02:02:10 +08:00
|
|
|
AZURE_ACCESS_TOKEN: ${{ steps.azure-oidc-auth.outputs.access-token }}
|
2023-02-25 04:06:07 +08:00
|
|
|
with:
|
|
|
|
owner: dotnet
|
|
|
|
repo: AspNetCore.Docs
|
|
|
|
savedir: './aspnetcore/whats-new'
|
2021-06-26 03:21:28 +08:00
|
|
|
|
|
|
|
- name: create-pull-request
|
2023-02-25 04:06:07 +08:00
|
|
|
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04
|
2021-06-26 03:21:28 +08:00
|
|
|
with:
|
2023-02-25 04:06:07 +08:00
|
|
|
branch: create-whatsnew-pull-request/patch
|
|
|
|
title: "What's new article"
|
2021-06-26 03:21:28 +08:00
|
|
|
commit-message: 'Bot 🤖 generated "What''s new article"'
|
2023-02-25 04:06:07 +08:00
|
|
|
body: "Automated creation of What's new article."
|