-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (60 loc) · 1.76 KB
/
includes.yml
File metadata and controls
67 lines (60 loc) · 1.76 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
name: +Mᐁ includes
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- '**.md'
- '!changelog.md'
- 'osmfeula.txt'
jobs:
includes:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: 🤖 defaults
uses: devlooped/actions-bot@v1
with:
name: ${{ secrets.BOT_NAME }}
email: ${{ secrets.BOT_EMAIL }}
gh_token: ${{ secrets.GH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 🤘 checkout
uses: actions/checkout@v4
with:
token: ${{ env.GH_TOKEN }}
- name: +Mᐁ includes
uses: devlooped/actions-includes@v1
- name: 📝 OSMF EULA
shell: pwsh
run: |
$file = "osmfeula.txt"
$props = "src/Directory.Build.props"
if (-not (test-path $file) -or -not (test-path $props)) {
exit 0
}
$product = dotnet msbuild $props -getproperty:Product
if (-not $product) {
write-error 'To use OSMF EULA, ensure the $(Product) property is set in Directory.props'
exit 1
}
((get-content -raw $file) -replace '\$product\$',$product).trim() | set-content $file
- name: ✍ pull request
uses: peter-evans/create-pull-request@v8
with:
add-paths: |
**.md
*.txt
base: main
branch: markdown-includes
delete-branch: true
labels: dependencies
author: ${{ env.BOT_AUTHOR }}
committer: ${{ env.BOT_AUTHOR }}
commit-message: +Mᐁ includes
title: +Mᐁ includes
body: +Mᐁ includes
token: ${{ env.GH_TOKEN }}