forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 2.41 KB
/
whats-new.yml
File metadata and controls
69 lines (59 loc) · 2.41 KB
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
61
62
63
64
65
66
67
68
69
# 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"
env:
DOTNET_VERSION: "6.0.x" # set this to the dot net version to use
# 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
permissions:
contents: write
pull-requests: write
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Setup .NET
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Runs a single command using the runners shell
- name: "Print manual run reason"
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "Reason: ${{ github.event.inputs.reason }}"
# Print dotnet info
- name: Display .NET info
run: dotnet --info
# Install dotnet-whatsnew global tool
- name: Install dotnet-whatsnew tool
run: |
dotnet tool install --global --add-source ./.github/workflows/dependencies/ dotnet-whatsnew
# Run dotnet-whatsnew tool
- name: Generate what's new
id: dotnet-whatsnew
env:
GitHubKey: ${{ secrets.GITHUB_TOKEN }}
OspoKey: ${{ secrets.OSPO_KEY }}
run: |
./.github/workflows/dependencies/run-dotnet-whatsnew.sh -o dotnet -r docs -s './docs/whats-new'
# Create the PR for the new article
- name: create-pull-request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0
with:
title: "What's new article"
commit-message: 'Bot 🤖 generated "What''s new article"'
body: "Automated creation of What's new article."