Skip to content

Commit ecb17e9

Browse files
committed
ci: configure CI to update plugin
1 parent 487028d commit ecb17e9

File tree

2 files changed

+57
-5
lines changed

2 files changed

+57
-5
lines changed

.github/.workflows/create-release-on-merge.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
name: Create Release on PR Merge
22

33
on:
4-
pull_request:
4+
workflow_run:
5+
workflows: ["Update Plugin Data"]
56
types:
6-
- closed
7+
- completed
78
branches:
89
- main
910

1011
jobs:
1112
create-release:
12-
# Only run if the PR was merged (not just closed)
13-
if: github.event.pull_request.merged == true
13+
# Only run if the update workflow succeeded
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1415
runs-on: ubuntu-latest
1516
permissions:
1617
contents: write
@@ -65,4 +66,4 @@ jobs:
6566
readmes.zip
6667
plugins-and-readmes.zip
6768
draft: false
68-
prerelease: false
69+
prerelease: false
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Update Plugin Data
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- main
9+
workflow_dispatch: # Allow manual trigger
10+
11+
jobs:
12+
update-data:
13+
# Only run if the PR was merged (not just closed)
14+
if: github.event.pull_request.merged == true
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v5
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v7
25+
26+
- name: Set up Python
27+
run: uv python install
28+
29+
- name: Sync plugin metadata
30+
run: uv run sync
31+
32+
- name: Get README files
33+
run: uv run get-readme
34+
35+
- name: Check for changes
36+
id: git-check
37+
run: |
38+
git diff --exit-code || echo "has_changes=true" >> $GITHUB_OUTPUT
39+
40+
- name: Commit and push changes
41+
if: steps.git-check.outputs.has_changes == 'true'
42+
run: |
43+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
44+
git config --local user.name "github-actions[bot]"
45+
git add .
46+
git commit -m "chore: update plugin metadata and READMEs [automated]"
47+
git push
48+
49+
- name: No changes detected
50+
if: steps.git-check.outputs.has_changes != 'true'
51+
run: echo "No changes to commit"

0 commit comments

Comments
 (0)