Skip to content

Update Plugin Index

Update Plugin Index #1

Workflow file for this run

name: Update Plugin Index
on:
workflow_run:
workflows: ["Publish Plugin"]
types:
- completed
workflow_dispatch:
concurrency:
group: update-index
cancel-in-progress: true
permissions:
contents: write
jobs:
update-index:
runs-on: ubuntu-latest
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Generate index.json
run: bash scripts/generate-index.sh
- name: Check for changes
id: diff
run: |
if git diff --quiet index.json; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push
if: steps.diff.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add index.json
git commit -m "Update plugin index"
git push