Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodbyeNJN committed May 9, 2023
1 parent 3332fdc commit 35af54b
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/cronjob.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CronJob

on:
workflow_dispatch:
schedule:
- cron: "0 */1 * * *"

jobs:
get_wechat_version:
name: Get Wechat Version
runs-on: windows-latest
steps:
- name: Execute PowerShell commands
id: powershell
shell: pwsh
run: |
$SetupFilePath="$env:TEMP\WeChatSetup.exe"
$InstalledFilePath="${env:ProgramFiles(x86)}\Tencent\WeChat"
Invoke-WebRequest -Uri "https://dldir1.qq.com/weixin/Windows/WeChatSetup.exe" -OutFile $SetupFilePath
Invoke-Expression "$SetupFilePath /S"
$DirectoryName=Get-ChildItem -Path $InstalledFilePath -Filter "[*]" -Directory -Name
$Version=$DirectoryName.Trim("[]")
echo "::set-output name=version::$Version"
run_update_script:
name: Run Update Script
needs: get_wechat_version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Run gen.sh with version
uses: vufa/arch-makepkg-action@master
with:
scripts: ./gen.sh -u ${{ needs.get_wechat_version.outputs.version }}

- name: Check git status
id: status
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::set-output name=changed::true"
fi
- name: Create pull request if changed
if: steps.status.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v5
with:
title: Update WeChat version to ${{ needs.build_and_push.outputs.version }}
commit-message: Update WeChat version to ${{ needs.build_and_push.outputs.version }}
base: action
delete-branch: true
branch-suffix: timestamp

0 comments on commit 35af54b

Please sign in to comment.