Skip to content

Commit

Permalink
Merge pull request #37 from soderlind/housekeeping
Browse files Browse the repository at this point in the history
Enhance GitHub Actions workflow for WordPress deployment with attesta…
  • Loading branch information
soderlind authored Jan 15, 2025
2 parents 15f509f + 5e38c3a commit 141f2ee
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,29 @@ name: Deploy to WordPress.org
on:
push:
tags:
- "*"
- '*'
jobs:
tag:
name: New tag
runs-on: ubuntu-latest
permissions:
attestations: write
contents: read
id-token: write
steps:
- name: Install Subversion
run: sudo apt-get update && sudo apt-get install -y subversion
- name: Checkout code
uses: actions/checkout@v4
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
- name: Install Subversion
run: sudo apt-get update && sudo apt-get install -y subversion
- name: Checkout code
uses: actions/checkout@v4
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
id: deploy
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
with:
generate-zip: true
- name: Generate build provenance attestation
uses: johnbillion/[email protected]
with:
zip-path: ${{ steps.deploy.outputs.zip-path }}
12 changes: 11 additions & 1 deletion super-admin-all-sites-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public function __construct(
private int $cache_expiration = Config::CACHE_EXPIRATION
) {}

/**
* Initialize the plugin.
*
* @return void
*/
public function init(): void {

// Only for super admins and REST API requests.
Expand All @@ -75,6 +80,11 @@ public function init(): void {
$this->register_hooks();
}

/**
* Register hooks.
*
* @return void
*/
private function register_hooks(): void {
add_action( 'admin_bar_init', [ $this, 'action_admin_bar_init' ] );
add_action( 'rest_api_init', [ $this, 'action_rest_api_init' ] );
Expand Down Expand Up @@ -446,7 +456,7 @@ public function plugin_update_local_storage( string $plugin ): void {
}

/**
* Fires after the a blog is renamed.
* Fires after a blog is renamed.
*
* @param mixed $old_value The old option value.
* @param mixed $value The new option value.
Expand Down

0 comments on commit 141f2ee

Please sign in to comment.