Skip to content

Fix & Enhance API refs tool#3230

Open
adriendupuis wants to merge 30 commits into
5.0from
enh-api_refs-tool
Open

Fix & Enhance API refs tool#3230
adriendupuis wants to merge 30 commits into
5.0from
enh-api_refs-tool

Conversation

@adriendupuis

@adriendupuis adriendupuis commented May 22, 2026

Copy link
Copy Markdown
Contributor
Question Answer
JIRA Ticket
Versions
Edition
  • Composer now ask for authentication in the create-project step. When an auth.json file is passed has tool argument, internally use COMPOSER_AUTH for create-project.
  • The README.md was outdated.
  • New inputs base_branch, work_branch, and force
    • base_branch is starting branch, then the target of the PR
    • work_branch is the branch the build is committed to. If it exists, the push will be rejected by default. It can be overwritten/force-pushed if force=true; If the PR for base_branch and work_branch already exists, it's updated.
    • Tests:
      • gh workflow run api_refs.yaml -f version=v5.0.8 --ref fix-api_refs-tool -f base_branch=enh-api_refs-tool -f work_branch=my-api-refs open a new 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=enh-api_refs-tool -f work_branch=my-api-refs failed.
      • gh workflow run api_refs.yaml -f version=v5.0.10 -f use_dev_version=true --ref fix-api_refs-tool -f base_branch=enh-api_refs-tool -f work_branch=my-api-refs -f force=true update the branch and the PR.
  • Composer binary as a variable
    To control PHP version and avoid some memory issue, I use locally:
    PHP_BINARY="/opt/homebrew/opt/php@8.4/bin/php -d memory_limit=-1 -d error_reporting=`php -r 'echo E_ALL & ~E_DEPRECATED;'`";
    COMPOSER_BINARY="$PHP_BINARY $(which composer)"
    
  • Avoid the hint about master branch being deprecated when initializing Git for recipes.

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

```
+ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: will change to "main" in Git 3.0. To configure the initial branch name
```
@github-actions

Copy link
Copy Markdown

Preview of modified files: no change to preview.

@sonarqubecloud

Copy link
Copy Markdown

@adriendupuis
adriendupuis changed the base branch from 5.0 to fix-api_refs-tool July 22, 2026 13:57
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Status Count
🔍 Total 736678
🔗 Unique 14795
✅ Successful 6217
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 730461
❓ Unknown 0
🚫 Errors 0
⛔ Unsupported 0

Full Github Actions output

adriendupuis and others added 13 commits July 22, 2026 16:01
fatal: 'origin' does not appear to be a git repository
fatal: 'origin' does not appear to be a git repository
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.
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>
Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
# Conflicts:
#	tools/api_refs/api_refs.sh
@adriendupuis
adriendupuis changed the base branch from fix-api_refs-tool to 5.0 July 24, 2026 07:37
@adriendupuis
adriendupuis marked this pull request as ready for review July 24, 2026 07:37
@adriendupuis
adriendupuis requested a review from mnocon July 24, 2026 07:38
@adriendupuis adriendupuis changed the title Enhance API refs tool Fix & Enhance API refs tool Jul 24, 2026
with:
ref: ${{ steps.version_and_branches.outputs.base_branch }}

- name: Check if work branch exists

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.

For performance optimization, it should be moved above the checkout. But the checkout step does more than just checkout. Among other things, it seems to set Git authentication.

When I moved it before the checkout, I had fatal: 'origin' does not appear to be a git repository error.

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.

2 participants