-
-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (48 loc) · 1.76 KB
/
Copy pathrefresh.yml
File metadata and controls
54 lines (48 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
name: Refresh the index
on:
workflow_dispatch:
schedule:
- cron: '28 */4 * * *'
push:
branches:
- main
paths:
- '.github/workflows/refresh.yml'
- 'src/WingetIndexGenerator/**'
jobs:
refresh-index:
name: 📃 Refresh the index
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 👨💻 Check-out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 👨🔧 Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: 📃 Regenerate index
# This step needs an id because it sets an output named `packages_updated` with the number of packages that were updated.
id: generate_index
run: dotnet run --project src/WingetIndexGenerator/WingetIndexGenerator.csproj -c Release -- generate
- name: 📤 Push changes
shell: pwsh
# This step only runs if the `packages_updated` output from the previous step is greater than 0.
if: steps.generate_index.outputs.packages_updated > 0
run: |
$commitMessages = @(
"Added some spice to the package stew 🌶️",
"Packages updated. Robots are taking over 🤖",
"Fresh packages, straight out of the oven 🍞",
"New packages delivered by carrier pigeon 🕊️",
"Index refreshed. Packages now 20% cooler ❄️"
)
git config --local user.email "1292510+svrooij@users.noreply.github.com"
git config --local user.name "GitHub Actions"
git add index.json index.csv index.v2.json index.v2.csv
$commitMessage = $commitMessages | Get-Random
git commit -m $commitMessage
git push