Skip to content

Commit 9cf39f5

Browse files
committed
Add file-update.yml to CI scripts.
1 parent f2deff2 commit 9cf39f5

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

CI/file-update.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Update Single File Dependencies
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * 0'
7+
8+
defaults:
9+
run:
10+
shell: pwsh
11+
12+
env:
13+
DOTNET_NOLOGO: true
14+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
15+
DOTNET_CLI_TELEMETRY_OPTOUT: true
16+
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
21+
jobs:
22+
Update:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
show-progress: false
29+
fetch-depth: 1
30+
- name: Update
31+
# Both must be set because dotnet-file internally calls gh cli to fetch the changelog.
32+
env:
33+
GCM_CREDENTIAL_STORE: cache
34+
GH_TOKEN: ${{ github.token }}
35+
id: update
36+
run: |
37+
dotnet tool update -g dotnet-file
38+
39+
[string]$tmpfile = New-TemporaryFile
40+
dotnet-file update "-c:$tmpfile"
41+
42+
[string]$content = Get-Content $tmpfile -Raw
43+
if (-not $content) {
44+
'No changelog.'
45+
}
46+
else {
47+
Write-Output 'Changelog<<EOF' >>$env:GITHUB_OUTPUT
48+
Write-Output $content >>$env:GITHUB_OUTPUT
49+
Write-Output 'EOF' >>$env:GITHUB_OUTPUT
50+
$content
51+
}
52+
- name: Pull Request
53+
uses: peter-evans/create-pull-request@v5
54+
with:
55+
base: master
56+
branch: dotnet-file-sync
57+
delete-branch: true
58+
labels: dependencies
59+
title: Update Single File Dependencies
60+
body: ${{ steps.update.outputs.Changelog }}
61+
commit-message: |
62+
Update Single File Dependencies
63+
64+
${{ steps.sync.outputs.Changelog }}

0 commit comments

Comments
 (0)