-
Notifications
You must be signed in to change notification settings - Fork 82
API Refs: Fix Composer authentication #3308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
7b1cffe
1b4ac28
aff679f
fa0d44c
e31c321
6673291
8f370c4
a9456d9
6b95db9
ee028f7
869e544
72edb9a
820de14
5b7a3b3
3ecd58f
d3a8b2d
a399a19
14f74d5
2ac2957
f2c809d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,19 @@ | |
| required: false | ||
| type: boolean | ||
| default: false | ||
| base_branch: | ||
| description: 'Start from this branch of the doc to build the refs (default: Maj.min from version)' | ||
| required: false | ||
| type: string | ||
| work_branch: | ||
| description: 'Commit builds to this branch of the doc (default: api_refs_<version>})' | ||
| required: false | ||
| type: string | ||
| force: | ||
| description: 'Push to work_branch even if it exists (default: false)' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| open_php_api_ref_pr: | ||
|
|
@@ -30,13 +43,19 @@ | |
| # Strip leading 'v' to get a plain version number (e.g. 5.0.9) | ||
| version="${{ inputs.version }}" | ||
| version="${version#v}" | ||
| base_branch="$(echo $version | sed 's/\(.*\..*\)\..*/\1/')" | ||
| work_branch="api_refs_v${version}" | ||
| base_branch="${{ inputs.base_branch }}" | ||
Check failureCode scanning / SonarCloud GitHub Actions should not be vulnerable to script injections High
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. See more on SonarQube Cloud
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| if [ -z "$base_branch" ]; then | ||
| base_branch="$(echo $version | sed 's/\(.*\..*\)\..*/\1/')" | ||
| fi | ||
| work_branch="${{ inputs.work_branch }}" | ||
Check failureCode scanning / SonarCloud GitHub Actions should not be vulnerable to script injections High
inputs.work\_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. See more on SonarQube Cloud
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| if [ -z "$work_branch" ]; then | ||
| work_branch="api_refs_v${version}" | ||
| fi | ||
|
|
||
| if [[ "${{ inputs.use_dev_version }}" == "true" ]]; then | ||
| # Dev build: install from the x-dev branch and label output with the target version | ||
| dxp_version="v${base_branch}.x-dev" | ||
| base_dxp_branch="${base_branch}" | ||
| base_dxp_branch="$(echo $version | sed 's/\(.*\..*\)\..*/\1/')" | ||
| dxp_version="v${base_dxp_branch}.x-dev" | ||
| virtual_dxp_version="${version}" | ||
| else | ||
| # Stable build: install from the released tag | ||
|
|
@@ -52,6 +71,14 @@ | |
| echo "base_dxp_branch=${base_dxp_branch}" >> "$GITHUB_OUTPUT" | ||
| echo "virtual_dxp_version=${virtual_dxp_version}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Check if work branch exists | ||
| id: check_work_branch | ||
| if: inputs.force == false | ||
|
Comment on lines
+84
to
+86
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 When I moved it before the checkout, I had |
||
| run: | | ||
| if git ls-remote --exit-code --heads origin "${{ steps.version_and_branches.outputs.work_branch }}"; then | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Checkout documentation | ||
| uses: actions/checkout@v4 | ||
| with: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.