This repository was archived by the owner on Jun 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 10
58 lines (51 loc) · 1.63 KB
/
dotnet-file.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
# Synchronizes .netconfig-configured files with dotnet-file
name: dotnet-file
on:
schedule:
- cron: "0 0 * * *"
push:
branches: [ 'dotnet-file' ]
env:
DOTNET_NOLOGO: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
jobs:
sync:
runs-on: windows-latest
steps:
- name: 🔍 GH_TOKEN
if: env.GH_TOKEN == ''
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
- name: 🤘 checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: main
token: ${{ env.GH_TOKEN }}
- name: 🔄 sync
run: |
dotnet tool update -g dotnet-gcm
dotnet gcm store --protocol=https --host=github.com --username=$env:GITHUB_ACTOR --password=$env:GH_TOKEN
gh auth status
dotnet tool update -g dotnet-file
dotnet file sync -c:$env:TEMP\dotnet-file.md
if (test-path $env:TEMP\dotnet-file.md) {
echo 'CHANGES<<EOF' >> $env:GITHUB_ENV
cat $env:TEMP\dotnet-file.md >> $env:GITHUB_ENV
echo 'EOF' >> $env:GITHUB_ENV
cat $env:TEMP\dotnet-file.md
} else {
echo 'No changelog was generated'
}
- name: ✍ pull request
uses: peter-evans/create-pull-request@v3
with:
base: main
branch: dotnet-file-sync
commit-message: Bump files with dotnet-file sync
${{ env.CHANGES }}
title: "Bump files with dotnet-file sync"
body: ${{ env.CHANGES }}
token: ${{ env.GH_TOKEN }}