Skip to content

API Refs: Fix Composer authentication#3308

Open
adriendupuis wants to merge 19 commits into
5.0from
fix-api_refs-tool
Open

API Refs: Fix Composer authentication#3308
adriendupuis wants to merge 19 commits into
5.0from
fix-api_refs-tool

Conversation

@adriendupuis

@adriendupuis adriendupuis commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
Question Answer
JIRA Ticket
Versions
Edition
  • Composer now ask for authentication in the create-project step.
  • The README.md was outdated.
  • base_branch as a input for test purpose. Tested with success:
    • gh workflow run api_refs.yaml -f version=v5.0.9 -f use_dev_version=false --ref fix-api_refs-tool -f base_branch=fix-api_refs-tool built but nothing new found (run) so no PR.
    • gh workflow run api_refs.yaml -f version=v5.0.10 -f use_dev_version=true --ref fix-api_refs-tool -f base_branch=fix-api_refs-tool (run) opened PR API Refs v5.0.10 #3310

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

@github-actions

Copy link
Copy Markdown

Preview of modified files: no change to preview.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Status Count
🔍 Total 763521
🔗 Unique 15042
✅ Successful 6328
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 757193
❓ Unknown 0
🚫 Errors 0
⛔ Unsupported 0

Full Github Actions output

Comment thread .github/workflows/api_refs.yaml Fixed
@adriendupuis
adriendupuis marked this pull request as ready for review July 22, 2026 13:59
Comment thread .github/workflows/api_refs.yaml Fixed
fatal: 'origin' does not appear to be a git repository
fatal: 'origin' does not appear to be a git repository
Comment on lines +79 to +81
- name: Check if work branch exists
id: check_work_branch
if: inputs.force == false

@adriendupuis adriendupuis Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I set this check step after the checkout step so remote repo is initialized and origin exists.

When I moved it before the checkout, I had fatal: 'origin' does not appear to be a git repository error. For performance, it could have been nice to have it before checkout but it seems there are many things to reproduce like Git authentication.

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.

Pull request overview

Updates the API reference generation tooling to avoid Composer authentication prompts during create-project, refreshes the tool README, and extends the api_refs GitHub Action to support configurable base/work branches (plus an optional “force” behavior).

Changes:

  • Pass Composer auth via COMPOSER_AUTH during composer create-project and reduce shell tracing output.
  • Update tools/api_refs/README.md to reflect PHP + REST refs generation and document GitHub Action usage.
  • Add base_branch, work_branch, and force inputs to .github/workflows/api_refs.yaml, including a work-branch existence guard.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
tools/api_refs/README.md Updates usage docs and adds GitHub Action invocation examples for building refs.
tools/api_refs/api_refs.sh Adjusts auth handling for Composer create-project during refs generation.
.github/workflows/api_refs.yaml Adds workflow inputs for controlling base/work branches and guarding against existing branches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/api_refs/api_refs.sh Outdated
Comment thread tools/api_refs/api_refs.sh
Comment thread tools/api_refs/README.md Outdated
Comment thread .github/workflows/api_refs.yaml Outdated
Hey, Do you know how to execute the following security suggestion in github action @api_refs.yaml?:

inputs.base_branch is vulnerable to script injection: values of inputs are provided by whoever triggers the workflow. Change this workflow to not use user-controlled data directly in a run block, for example by assigning this expression to an environment variable.
Comment thread tools/api_refs/api_refs.sh Outdated
Comment thread tools/api_refs/README.md Outdated
adriendupuis and others added 2 commits July 23, 2026 16:07
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Comment thread tools/api_refs/README.md Outdated
Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.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.

3 participants