Skip to content

ci: run composer commands with sudo in plugin CI workflow - #30

Merged
TheWitness merged 1 commit into
developfrom
ci/fix-permissions
Sep 18, 2026
Merged

TheWitness merged 1 commit into
developfrom
ci/fix-permissions

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Summary

The Install Composer Dependencies step in .github/workflows/plugin-ci-workflow.yml ran composer config, composer require, rm, and composer install without sudo. Recent changes to the CI runner mean these commands need elevated permissions to write to the shared cacti checkout, so the step was failing.

Changes

  • Prefix composer config, composer require, rm -f composer.lock, and composer install with sudo in the Pest install step.
  • Drop the deprecated --dev flag from composer require (Composer no longer supports it on require).

Before

composer config --no-plugins allow-plugins.pestphp/pest-plugin true
composer require --dev --no-progress --no-interaction "pestphp/pest: ^3" "pestphp/pest-plugin-drift: ^3.0"
rm -f composer.lock
composer install --dev --no-progress

After

sudo composer config --no-plugins allow-plugins.pestphp/pest-plugin true
sudo composer require --no-progress --no-interaction "pestphp/pest: ^3" "pestphp/pest-plugin-drift: ^3.0"
sudo rm -f composer.lock
sudo composer install --dev --no-progress

The Pest install step in .github/workflows/plugin-ci-workflow.yml now runs
composer config, composer require, rm, and composer install with sudo so
the step can write to directories owned by another user in the CI
runner. Also drop the deprecated --dev flag from composer require.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Composer needs COMPOSER_ALLOW_SUPERUSER=1 or a non-root execution approach.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates the plugin CI workflow to run Composer operations with sudo and removes the deprecated --dev option.

Changes:

  • Runs Composer and lock-file commands with elevated permissions.
  • Removes --dev from composer require.
File summaries
File Description
.github/workflows/plugin-ci-workflow.yml Adjusts Composer dependency installation commands.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/plugin-ci-workflow.yml
@TheWitness
TheWitness merged commit b40fbe6 into develop Sep 18, 2026
4 checks passed
@TheWitness
TheWitness deleted the ci/fix-permissions branch September 18, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants