Skip to content

Hide "Edit post type" Command Palette command from users who cannot edit post types #601

Hide "Edit post type" Command Palette command from users who cannot edit post types

Hide "Edit post type" Command Palette command from users who cannot edit post types #601

Workflow file for this run

name: JavaScript Unit Tests
on:
pull_request:
branches: [trunk]
push:
branches: [trunk]
# Allow manually triggering the workflow
workflow_dispatch:
# Cancels all previous workflow runs for pull requests that have not completed
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
# Disable permissions for all available scopes by default
permissions: {}
jobs:
unit-js:
name: Node.js ${{ matrix.node }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
event: ['${{ github.event_name }}']
node: ['20', '22', '24']
exclude:
# On PRs: only test minimum supported version
- event: 'pull_request'
node: '22'
- event: 'pull_request'
node: '24'
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
show-progress: false
persist-credentials: false
- name: Setup Node.js and install dependencies
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:unit -- --ci --coverage
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/unit/lcov.info
flags: javascript
slug: WordPress/secure-custom-fields
name: unit-js-node-${{ matrix.node }}
fail_ci_if_error: false