Skip to content

Commit 9ab8451

Browse files
committed
chore: scope release workflow permissions
1 parent 9c50689 commit 9ab8451

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
types: [published]
66
workflow_dispatch:
77

8-
permissions:
9-
contents: write
10-
118
jobs:
129
lint:
1310
name: PHPCS Lint
@@ -39,8 +36,27 @@ jobs:
3936
- name: Build ZIP
4037
run: ./build-zip.sh
4138

39+
- name: Upload ZIP artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: plugin-zip
43+
path: aeo-content-ai-studio.zip
44+
if-no-files-found: error
45+
46+
release_asset:
47+
name: Upload ZIP to GitHub Release
48+
runs-on: ubuntu-latest
49+
if: ${{ github.event_name == 'release' }}
50+
needs: build
51+
permissions:
52+
contents: write
53+
steps:
54+
- name: Download ZIP artifact
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: plugin-zip
58+
4259
- name: Upload ZIP to release
43-
if: ${{ github.event_name == 'release' }}
4460
uses: softprops/action-gh-release@v2
4561
with:
4662
files: aeo-content-ai-studio.zip
@@ -50,7 +66,7 @@ jobs:
5066
name: Deploy to WordPress.org
5167
runs-on: ubuntu-latest
5268
if: ${{ github.event_name == 'release' }}
53-
needs: [lint, build]
69+
needs: [lint, build, release_asset]
5470
steps:
5571
- name: Checkout
5672
uses: actions/checkout@v5

0 commit comments

Comments
 (0)