Skip to content

refactor: deduplicate workflow steps via composite actions#50

Draft
DeepDiver1975 wants to merge 15 commits into
mainfrom
feat/workflow-deduplication
Draft

refactor: deduplicate workflow steps via composite actions#50
DeepDiver1975 wants to merge 15 commits into
mainfrom
feat/workflow-deduplication

Conversation

@DeepDiver1975
Copy link
Copy Markdown
Member

Summary

  • Extract 3 composite actions into .github/actions/ to eliminate copy-pasted step clusters across 5 workflows
  • setup-owncloud-env: consolidates the checkout cluster (validate app-repository, clone core, checkout app, optional additional-app) — used by php-codestyle, php-unit, js-unit
  • setup-php-server: consolidates PHP setup + server install — single source of truth for the shivammathur/setup-php SHA pin and database switching logic
  • github-app-pr: consolidates GitHub App token generation + PR creation — fixes version drift between translation-sync (v3.1.1) and calens (v1.11.6) for actions/create-github-app-token

Security improvements (carried in from fixup commits)

Bug fix

  • Replaced invalid case() expression in php-codestyle and php-unit core-ref selection (not a valid GitHub Actions function) with the correct &&/|| ternary idiom

Impact

Metric Before After
shivammathur/setup-php pins 3 1
actions/create-github-app-token pins 2 (drifted) 1
peter-evans/create-pull-request pins 2 1
Steps per PHP workflow ~13 ~7

Test plan

  • All 8 changed YAML files pass python3 -c "import yaml; yaml.safe_load(open(f))" (verified locally)
  • Run php-codestyle workflow on a test app to confirm checkout + PHP setup + style checks work
  • Run php-unit workflow with SQLite and at least one DB (mysql/postgres) to confirm database switching
  • Run js-unit workflow to confirm combined setup-app step works
  • Trigger translation-sync on a branch to confirm token + PR step fires correctly
  • Trigger calens on a branch to confirm base branch is set on the PR

🤖 Generated with Claude Code

@DeepDiver1975 DeepDiver1975 marked this pull request as draft April 17, 2026 13:37
… resolve

Reusable workflows run in a fresh workspace — ./.github/actions/* doesn't
exist until the repo is checked out. Check out owncloud/reusable-workflows
into _rw/ at github.workflow_sha as the first step in each workflow, then
reference composite actions as ./_rw/.github/actions/.... Add clean: false
to subsequent checkouts that would otherwise wipe the _rw/ directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant