refactor: update GitHub Actions workflow for app-upgrade-config

- Renamed job from 'propose-update' to 'update-config' for clarity.
- Replaced pull request creation step with direct commit and push to streamline the update process.
- Configured Git user for automated commits to improve workflow reliability.
This commit is contained in:
kangfenmao 2025-12-08 13:32:57 +08:00
parent e1e6702425
commit 61c171dafc

View File

@ -19,10 +19,9 @@ on:
permissions: permissions:
contents: write contents: write
pull-requests: write
jobs: jobs:
propose-update: update-config:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && github.event.release.draft == false) if: github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && github.event.release.draft == false)
@ -187,25 +186,20 @@ jobs:
echo "changed=true" >> "$GITHUB_OUTPUT" echo "changed=true" >> "$GITHUB_OUTPUT"
fi fi
- name: Create pull request - name: Commit and push changes
if: steps.check.outputs.should_run == 'true' && steps.diff.outputs.changed == 'true' if: steps.check.outputs.should_run == 'true' && steps.diff.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v7 working-directory: cs
with: run: |
path: cs git config user.name "github-actions[bot]"
base: x-files/app-upgrade-config git config user.email "github-actions[bot]@users.noreply.github.com"
branch: chore/update-app-upgrade-config/${{ steps.meta.outputs.safe_tag }} git add app-upgrade-config.json
commit-message: "🤖 chore: sync app-upgrade-config for ${{ steps.meta.outputs.tag }}" git commit -m "chore: sync app-upgrade-config for ${{ steps.meta.outputs.tag }}" -m "Automated update triggered by \`${{ steps.meta.outputs.trigger }}\`.
title: "chore: update app-upgrade-config for ${{ steps.meta.outputs.tag }}"
body: |
Automated update triggered by `${{ steps.meta.outputs.trigger }}`.
- Source tag: `${{ steps.meta.outputs.tag }}` - Source tag: \`${{ steps.meta.outputs.tag }}\`
- Pre-release: `${{ steps.meta.outputs.prerelease }}` - Pre-release: \`${{ steps.meta.outputs.prerelease }}\`
- Latest: `${{ steps.meta.outputs.latest }}` - Latest: \`${{ steps.meta.outputs.latest }}\`
- Workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - Workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
labels: | git push origin x-files/app-upgrade-config
automation
app-upgrade
- name: No changes detected - name: No changes detected
if: steps.check.outputs.should_run == 'true' && steps.diff.outputs.changed != 'true' if: steps.check.outputs.should_run == 'true' && steps.diff.outputs.changed != 'true'