Skip to content

Commit 822c032

Browse files
committed
Update dotnet-file.yml
1 parent 602d75c commit 822c032

File tree

1 file changed

+3
-73
lines changed

1 file changed

+3
-73
lines changed

.github/workflows/dotnet-file.yml

Lines changed: 3 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -11,76 +11,6 @@ env:
1111
DOTNET_NOLOGO: true
1212

1313
jobs:
14-
sync:
15-
runs-on: windows-latest
16-
continue-on-error: true
17-
steps:
18-
- name: 🤖 defaults
19-
uses: devlooped/actions-bot@v1
20-
with:
21-
name: ${{ secrets.BOT_NAME }}
22-
email: ${{ secrets.BOT_EMAIL }}
23-
gh_token: ${{ secrets.GH_TOKEN }}
24-
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
26-
- name: 🤘 checkout
27-
uses: actions/checkout@v2
28-
with:
29-
fetch-depth: 0
30-
ref: main
31-
token: ${{ env.GH_TOKEN }}
32-
33-
- name: ⌛ rate
34-
shell: pwsh
35-
run: |
36-
# add random sleep since we run on fixed schedule
37-
sleep (get-random -max 60)
38-
# get currently authenticated user rate limit info
39-
$rate = gh api rate_limit | convertfrom-json | select -expandproperty rate
40-
# if we don't have at least 100 requests left, wait until reset
41-
if ($rate.remaining -lt 10) {
42-
$wait = ($rate.reset - (Get-Date (Get-Date).ToUniversalTime() -UFormat %s))
43-
echo "Rate limit remaining is $($rate.remaining), waiting for $($wait / 1000) seconds to reset"
44-
sleep $wait
45-
$rate = gh api rate_limit | convertfrom-json | select -expandproperty rate
46-
echo "Rate limit has reset to $($rate.remaining) requests"
47-
}
48-
49-
- name: 🔄 sync
50-
shell: pwsh
51-
run: |
52-
dotnet tool update -g dotnet-gcm
53-
dotnet gcm store --protocol=https --host=github.com --username=$env:GITHUB_ACTOR --password=$env:GH_TOKEN
54-
gh auth status
55-
56-
dotnet tool update -g dotnet-file
57-
dotnet file sync -c:$env:TEMP\dotnet-file.md
58-
if (test-path $env:TEMP\dotnet-file.md) {
59-
echo 'CHANGES<<EOF' >> $env:GITHUB_ENV
60-
cat $env:TEMP\dotnet-file.md >> $env:GITHUB_ENV
61-
echo 'EOF' >> $env:GITHUB_ENV
62-
cat $env:TEMP\dotnet-file.md
63-
} else {
64-
echo 'No changelog was generated'
65-
}
66-
67-
- name: +Mᐁ includes
68-
uses: devlooped/actions-include@v1
69-
with:
70-
validate: false
71-
72-
- name: ✍ pull request
73-
uses: peter-evans/create-pull-request@v4
74-
with:
75-
base: main
76-
branch: dotnet-file-sync
77-
delete-branch: true
78-
labels: dependencies
79-
author: ${{ env.BOT_AUTHOR }}
80-
committer: ${{ env.BOT_AUTHOR }}
81-
commit-message: ⬆️ Bump files with dotnet-file sync
82-
83-
${{ env.CHANGES }}
84-
title: "⬆️ Bump files with dotnet-file sync"
85-
body: ${{ env.CHANGES }}
86-
token: ${{ env.GH_TOKEN }}
14+
run:
15+
uses: devlooped/oss/.github/workflows/dotnet-file-core.yml@main
16+
secrets: inherit

0 commit comments

Comments
 (0)