Repository navigation
58 lines (53 loc) · 2.52 KB
/
Copy pathplugin-check.yml
File metadata and controls
58 lines (53 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: 'WordPress.org Plugin Check'
on: # rebuild any PRs and main branch changes
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: wp-cli
# setup-php stores the ephemeral Actions token in ~/.composer/auth.json
# as a github-oauth credential. Composer rejects that token whenever it
# happens to contain a character its validator dislikes ("Your github
# oauth token for github.com contains invalid characters",
# composer#12076), so this step failed on roughly half of all runs
# depending on the token minted for that run.
#
# dist-archive-command is a PUBLIC package and needs no auth, so the
# fix is to delete the stored credential before installing. Clearing
# the env vars alone does NOT work — they are already empty here, and
# the credential lives on disk (verified in run 31784727273).
#
# Do NOT switch to the WP-CLI nightly to dodge this: it reports as
# wp-cli 3.0.0-alpha, and every released dist-archive-command requires
# wp-cli ^2 / ^2.13, so the install cannot resolve against it.
#
# Pinned to v3.1.0 deliberately: newest release accepting wp-cli ^2.
# v3.2.x requires ^2.13, which has no stable release (latest is 2.12.0).
- name: Install latest version of dist-archive-command
run: |
rm -f "$(composer config --global home 2>/dev/null)/auth.json"
wp package install wp-cli/dist-archive-command:v3.1.0
- name: Build plugin
run: |
wp dist-archive . ./${{ github.event.repository.name }}.zip
mkdir build
unzip ${{ github.event.repository.name }}.zip -d build
# v1.1.7 fixed the wp-env silent-startup failure ("Environment not
# initialized. Run `wp-env start` first.") that broke this job on newer
# runner images; v1.1.9 fixes a bundle regression in v1.1.8. Because
# that fix landed upstream, @wordpress/env needs no version pin here.
# https://github.com/WordPress/plugin-check-action/pull/590
- name: Run plugin check
uses: wordpress/plugin-check-action@v1.1.9
with:
build-dir: './build/${{ github.event.repository.name }}'
exclude-checks: |
direct_file_access