-
Notifications
You must be signed in to change notification settings - Fork 26
64 lines (64 loc) · 2.24 KB
/
automation.yml
File metadata and controls
64 lines (64 loc) · 2.24 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
name: Automation
on:
schedule:
- cron: 0 * * * *
workflow_dispatch:
inputs:
params:
description: Additional parameters passed to the script
required: false
type: string
jobs:
build:
name: Build
runs-on: windows-2025
concurrency:
group: ${{ github.workflow }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: Dumplings
submodules: true
# - name: Checkout upstream winget-pkgs
# uses: actions/checkout@v4
# with:
# repository: microsoft/winget-pkgs
# path: winget-pkgs
# - name: Install WinGet client
# run: .\Modules\PackageModule\Utilities\InstallWinGet.ps1
# working-directory: Dumplings
# shell: powershell
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Pull latest changes from the remote repository
run: git pull
working-directory: Dumplings
shell: pwsh
- name: Run tasks
run: .\Core\Index.ps1 -ThrottleLimit 2 -EnableWrite -EnableMessage -EnableSubmit ${{ github.event.inputs.params }}
working-directory: Dumplings
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_DUMPLINGS_TOKEN: ${{ secrets.GH_DUMPLINGS_TOKEN }}
DUMPLINGS_SECRET: ${{ secrets.DUMPLINGS_SECRET }}
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
TG_CHAT_ID: ${{ secrets.TG_CHAT_ID }}
MT_BOT_TOKEN: ${{ secrets.MT_BOT_TOKEN }}
MT_ROOM_ID: ${{ secrets.MT_ROOM_ID }}
- name: Commit and push local changes to the remote repository
run: |-
$Path = Join-Path $PWD 'Tasks'
if (-not [string]::IsNullOrWhiteSpace((git ls-files --other --modified --exclude-standard $Path))) {
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git pull
git add $Path
git commit -m "${env:GITHUB_WORKFLOW}: Update states [${env:GITHUB_RUN_NUMBER}]"
git push
} else {
Write-Host -Object 'No changes to commit'
}
working-directory: Dumplings
shell: pwsh