Add force_publish option to workflow

This commit is contained in:
lone-cloud 2026-03-13 17:39:56 -07:00
parent 69d59c6a52
commit 9efdd56735

View file

@ -4,7 +4,12 @@ on:
schedule: schedule:
# Check every 6 hours # Check every 6 hours
- cron: '0 */6 * * *' - cron: '0 */6 * * *'
workflow_dispatch: # Manual trigger workflow_dispatch:
inputs:
force_publish:
description: 'Force publish current version to AUR'
type: boolean
default: false
permissions: permissions:
contents: write contents: write
@ -32,13 +37,13 @@ jobs:
echo "latest_version=$(node -e "const d=JSON.parse(require('fs').readFileSync('check_result.json','utf8')); console.log(d.latest_version)")" >> "$GITHUB_OUTPUT" echo "latest_version=$(node -e "const d=JSON.parse(require('fs').readFileSync('check_result.json','utf8')); console.log(d.latest_version)")" >> "$GITHUB_OUTPUT"
- name: Update PKGBUILD - name: Update PKGBUILD
if: steps.check.outputs.update_available == 'true' if: steps.check.outputs.update_available == 'true' && !inputs.force_publish
run: | run: |
node update.ts --update node update.ts --update
echo "Updated to version $(grep '^pkgver=' PKGBUILD | cut -d= -f2)" echo "Updated to version $(grep '^pkgver=' PKGBUILD | cut -d= -f2)"
- name: Publish to AUR - name: Publish to AUR
if: steps.check.outputs.update_available == 'true' if: steps.check.outputs.update_available == 'true' || inputs.force_publish
uses: KSXGitHub/github-actions-deploy-aur@v4.1.1 uses: KSXGitHub/github-actions-deploy-aur@v4.1.1
with: with:
pkgname: cursor-ide-bin pkgname: cursor-ide-bin
@ -54,7 +59,7 @@ jobs:
cursor-launcher.sh cursor-launcher.sh
- name: Commit updated PKGBUILD to GitHub - name: Commit updated PKGBUILD to GitHub
if: steps.check.outputs.update_available == 'true' if: steps.check.outputs.update_available == 'true' && !inputs.force_publish
run: | run: |
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com" git config user.email "github-actions[bot]@users.noreply.github.com"