Skip to content

Conversation

@hein-obox
Copy link
Member

@hein-obox hein-obox commented Sep 4, 2025

✨ PR Description

Purpose: Add Hello Elementor release workflow automation by cloning and adapting release preparation system from Hello Commerce.

Main changes:

  • Created new release-preparation.yml workflow for automated versioning, building, and GitHub release creation
  • Added specialized actions for theme version bumping, changelog extraction, and PR creation
  • Implemented version validation script to ensure consistency across PHP, CSS, and readme files
  • Added build action with package version handling and zip file creation for releases

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using. We'd love your feedback! 🚀

shell: bash
run: |
if [ ! -f "${{ inputs.BUILD_ZIP_PATH }}" ]; then
echo "Error: Build zip file not found: ${{ inputs.BUILD_ZIP_PATH }}"

Check warning

Code scanning / CodeQL

Code injection Medium

Potential code injection in
${ inputs.BUILD_ZIP_PATH }
, which may be controlled by an external user.

Copilot Autofix

AI 4 months ago

The best fix is to pass user-controlled inputs (like BUILD_ZIP_PATH and CHANGELOG_FILE) to the script as environment variables using the env: block in the step, and to reference those entries within the shell script using the native shell variable syntax ("$BUILD_ZIP_PATH"). This ensures the shell receives the literal input as a variable, not as an evaluated shell statement, which prevents injection vulnerabilities.

Specifically, in file .github/actions/create-theme-release-release/action.yml:

  • Update the "Verify files exist" and "Release summary" steps to set all input values used in shell commands under an env: block.
  • Update all script references from ${{ inputs.BUILD_ZIP_PATH }} (and similar) to "$BUILD_ZIP_PATH", etc.
  • This fix involves only the lines within the two shell run: script steps.

Suggested changeset 1
.github/actions/create-theme-release-release/action.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/actions/create-theme-release-release/action.yml b/.github/actions/create-theme-release-release/action.yml
--- a/.github/actions/create-theme-release-release/action.yml
+++ b/.github/actions/create-theme-release-release/action.yml
@@ -28,20 +28,22 @@
   steps:
     - name: Verify files exist
       shell: bash
+      env:
+        BUILD_ZIP_PATH: ${{ inputs.BUILD_ZIP_PATH }}
+        CHANGELOG_FILE: ${{ inputs.CHANGELOG_FILE }}
       run: |
-        if [ ! -f "${{ inputs.BUILD_ZIP_PATH }}" ]; then
-          echo "Error: Build zip file not found: ${{ inputs.BUILD_ZIP_PATH }}"
+        if [ ! -f "$BUILD_ZIP_PATH" ]; then
+          echo "Error: Build zip file not found: $BUILD_ZIP_PATH"
           exit 1
         fi
         
-        if [ ! -f "${{ inputs.CHANGELOG_FILE }}" ]; then
-          echo "Error: Changelog file not found: ${{ inputs.CHANGELOG_FILE }}"
+        if [ ! -f "$CHANGELOG_FILE" ]; then
+          echo "Error: Changelog file not found: $CHANGELOG_FILE"
           exit 1
         fi
         
-        echo "✅ Build zip: ${{ inputs.BUILD_ZIP_PATH }}"
-        echo "✅ Changelog: ${{ inputs.CHANGELOG_FILE }}"
-    
+        echo "✅ Build zip: $BUILD_ZIP_PATH"
+        echo "✅ Changelog: $CHANGELOG_FILE"
     - name: Create GitHub release
       id: create-release
       uses: softprops/action-gh-release@v1
@@ -58,11 +53,16 @@
     
     - name: Release summary
       shell: bash
+      env:
+        PACKAGE_VERSION: ${{ inputs.PACKAGE_VERSION }}
+        PRE_RELEASE: ${{ inputs.PRE_RELEASE }}
+        BUILD_ZIP_PATH: ${{ inputs.BUILD_ZIP_PATH }}
+        RELEASE_URL: ${{ steps.create-release.outputs.html_url }}
       run: |
         echo "🚀 **Release Created Successfully!**"
         echo "📋 **Release Details:**"
-        echo "   - Version: v${{ inputs.PACKAGE_VERSION }}"
-        echo "   - Pre-release: ${{ inputs.PRE_RELEASE }}"
-        echo "   - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
-        echo "   - Release URL: ${{ steps.create-release.outputs.html_url }}"
-        echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV
+        echo "   - Version: v$PACKAGE_VERSION"
+        echo "   - Pre-release: $PRE_RELEASE"
+        echo "   - Build file: $BUILD_ZIP_PATH"
+        echo "   - Release URL: $RELEASE_URL"
+        echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV
EOF
@@ -28,20 +28,22 @@
steps:
- name: Verify files exist
shell: bash
env:
BUILD_ZIP_PATH: ${{ inputs.BUILD_ZIP_PATH }}
CHANGELOG_FILE: ${{ inputs.CHANGELOG_FILE }}
run: |
if [ ! -f "${{ inputs.BUILD_ZIP_PATH }}" ]; then
echo "Error: Build zip file not found: ${{ inputs.BUILD_ZIP_PATH }}"
if [ ! -f "$BUILD_ZIP_PATH" ]; then
echo "Error: Build zip file not found: $BUILD_ZIP_PATH"
exit 1
fi

if [ ! -f "${{ inputs.CHANGELOG_FILE }}" ]; then
echo "Error: Changelog file not found: ${{ inputs.CHANGELOG_FILE }}"
if [ ! -f "$CHANGELOG_FILE" ]; then
echo "Error: Changelog file not found: $CHANGELOG_FILE"
exit 1
fi

echo "✅ Build zip: ${{ inputs.BUILD_ZIP_PATH }}"
echo "✅ Changelog: ${{ inputs.CHANGELOG_FILE }}"

echo "✅ Build zip: $BUILD_ZIP_PATH"
echo "✅ Changelog: $CHANGELOG_FILE"
- name: Create GitHub release
id: create-release
uses: softprops/action-gh-release@v1
@@ -58,11 +53,16 @@

- name: Release summary
shell: bash
env:
PACKAGE_VERSION: ${{ inputs.PACKAGE_VERSION }}
PRE_RELEASE: ${{ inputs.PRE_RELEASE }}
BUILD_ZIP_PATH: ${{ inputs.BUILD_ZIP_PATH }}
RELEASE_URL: ${{ steps.create-release.outputs.html_url }}
run: |
echo "🚀 **Release Created Successfully!**"
echo "📋 **Release Details:**"
echo " - Version: v${{ inputs.PACKAGE_VERSION }}"
echo " - Pre-release: ${{ inputs.PRE_RELEASE }}"
echo " - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
echo " - Release URL: ${{ steps.create-release.outputs.html_url }}"
echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV
echo " - Version: v$PACKAGE_VERSION"
echo " - Pre-release: $PRE_RELEASE"
echo " - Build file: $BUILD_ZIP_PATH"
echo " - Release URL: $RELEASE_URL"
echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV
Copilot is powered by AI and may make mistakes. Always verify output.
exit 1
fi

if [ ! -f "${{ inputs.CHANGELOG_FILE }}" ]; then

Check warning

Code scanning / CodeQL

Code injection Medium

Potential code injection in
${ inputs.CHANGELOG_FILE }
, which may be controlled by an external user.
fi

if [ ! -f "${{ inputs.CHANGELOG_FILE }}" ]; then
echo "Error: Changelog file not found: ${{ inputs.CHANGELOG_FILE }}"

Check warning

Code scanning / CodeQL

Code injection Medium

Potential code injection in
${ inputs.CHANGELOG_FILE }
, which may be controlled by an external user.

Copilot Autofix

AI 4 months ago

To fix the problem, we should avoid using ${{ inputs.CHANGELOG_FILE }} directly inside command lines in run: blocks. The correct and safest fix is to:

  1. Assign the expression value to an environment variable via the env: directive.
  2. Reference the environment variable in the shell script using native shell syntax (e.g., $CHANGELOG_FILE) rather than further GitHub Action expressions.

Specifically, in the "Verify files exist" step, we should:

  • Set CHANGELOG_FILE: ${{ inputs.CHANGELOG_FILE }} in the env: block.
  • Replace any shell interpolations ${{ inputs.CHANGELOG_FILE }} with $CHANGELOG_FILE.

Do the same for other user-provided inputs (BUILD_ZIP_PATH) used in shell context for full coverage, but the flagged line is focused on CHANGELOG_FILE. Other usages (such as inside with: for actions) are not executed as shell scripts and thus are not susceptible in the same way.

No new external dependencies or method definitions are needed—just the use of existing GitHub Actions syntax.


Suggested changeset 1
.github/actions/create-theme-release-release/action.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/actions/create-theme-release-release/action.yml b/.github/actions/create-theme-release-release/action.yml
--- a/.github/actions/create-theme-release-release/action.yml
+++ b/.github/actions/create-theme-release-release/action.yml
@@ -28,19 +28,22 @@
   steps:
     - name: Verify files exist
       shell: bash
+      env:
+        BUILD_ZIP_PATH: ${{ inputs.BUILD_ZIP_PATH }}
+        CHANGELOG_FILE: ${{ inputs.CHANGELOG_FILE }}
       run: |
-        if [ ! -f "${{ inputs.BUILD_ZIP_PATH }}" ]; then
-          echo "Error: Build zip file not found: ${{ inputs.BUILD_ZIP_PATH }}"
+        if [ ! -f "$BUILD_ZIP_PATH" ]; then
+          echo "Error: Build zip file not found: $BUILD_ZIP_PATH"
           exit 1
         fi
         
-        if [ ! -f "${{ inputs.CHANGELOG_FILE }}" ]; then
-          echo "Error: Changelog file not found: ${{ inputs.CHANGELOG_FILE }}"
+        if [ ! -f "$CHANGELOG_FILE" ]; then
+          echo "Error: Changelog file not found: $CHANGELOG_FILE"
           exit 1
         fi
         
-        echo "✅ Build zip: ${{ inputs.BUILD_ZIP_PATH }}"
-        echo "✅ Changelog: ${{ inputs.CHANGELOG_FILE }}"
+        echo "✅ Build zip: $BUILD_ZIP_PATH"
+        echo "✅ Changelog: $CHANGELOG_FILE"
     
     - name: Create GitHub release
       id: create-release
EOF
@@ -28,19 +28,22 @@
steps:
- name: Verify files exist
shell: bash
env:
BUILD_ZIP_PATH: ${{ inputs.BUILD_ZIP_PATH }}
CHANGELOG_FILE: ${{ inputs.CHANGELOG_FILE }}
run: |
if [ ! -f "${{ inputs.BUILD_ZIP_PATH }}" ]; then
echo "Error: Build zip file not found: ${{ inputs.BUILD_ZIP_PATH }}"
if [ ! -f "$BUILD_ZIP_PATH" ]; then
echo "Error: Build zip file not found: $BUILD_ZIP_PATH"
exit 1
fi

if [ ! -f "${{ inputs.CHANGELOG_FILE }}" ]; then
echo "Error: Changelog file not found: ${{ inputs.CHANGELOG_FILE }}"
if [ ! -f "$CHANGELOG_FILE" ]; then
echo "Error: Changelog file not found: $CHANGELOG_FILE"
exit 1
fi

echo "✅ Build zip: ${{ inputs.BUILD_ZIP_PATH }}"
echo "✅ Changelog: ${{ inputs.CHANGELOG_FILE }}"
echo "✅ Build zip: $BUILD_ZIP_PATH"
echo "✅ Changelog: $CHANGELOG_FILE"

- name: Create GitHub release
id: create-release
Copilot is powered by AI and may make mistakes. Always verify output.
exit 1
fi

echo "✅ Build zip: ${{ inputs.BUILD_ZIP_PATH }}"

Check warning

Code scanning / CodeQL

Code injection Medium

Potential code injection in
${ inputs.BUILD_ZIP_PATH }
, which may be controlled by an external user.

Copilot Autofix

AI 4 months ago

To fix the issue, we should stop interpolating the expression ${{ inputs.BUILD_ZIP_PATH }} directly into the shell command. Instead, we should assign inputs.BUILD_ZIP_PATH (and similarly, inputs.CHANGELOG_FILE) to environment variables at the step level, and reference them in the shell using "${BUILD_ZIP_PATH}". This approach avoids code injection regardless of the value of the input, because the shell will not interpret injected special characters as part of its command structure. The fix should be applied to every occurrence where an untrusted input is interpolated directly, specifically lines 32, 33, 37, 38, 42, and 43 of the run: block in the "Verify files exist" step. The same should be done in other relevant steps if needed (but the error was raised for line 42). Changes are only within the shown code of the .github/actions/create-theme-release-release/action.yml file.

The solution consists of:

  • Adding an env: block to the relevant step, assigning inputs.BUILD_ZIP_PATH and inputs.CHANGELOG_FILE to environment variables with safe names.
  • Replacing all direct uses of ${{ inputs.BUILD_ZIP_PATH }} and ${{ inputs.CHANGELOG_FILE }} in the shell command with shell variable references $BUILD_ZIP_PATH and $CHANGELOG_FILE.

Suggested changeset 1
.github/actions/create-theme-release-release/action.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/actions/create-theme-release-release/action.yml b/.github/actions/create-theme-release-release/action.yml
--- a/.github/actions/create-theme-release-release/action.yml
+++ b/.github/actions/create-theme-release-release/action.yml
@@ -28,19 +28,22 @@
   steps:
     - name: Verify files exist
       shell: bash
+      env:
+        BUILD_ZIP_PATH: ${{ inputs.BUILD_ZIP_PATH }}
+        CHANGELOG_FILE: ${{ inputs.CHANGELOG_FILE }}
       run: |
-        if [ ! -f "${{ inputs.BUILD_ZIP_PATH }}" ]; then
-          echo "Error: Build zip file not found: ${{ inputs.BUILD_ZIP_PATH }}"
+        if [ ! -f "$BUILD_ZIP_PATH" ]; then
+          echo "Error: Build zip file not found: $BUILD_ZIP_PATH"
           exit 1
         fi
         
-        if [ ! -f "${{ inputs.CHANGELOG_FILE }}" ]; then
-          echo "Error: Changelog file not found: ${{ inputs.CHANGELOG_FILE }}"
+        if [ ! -f "$CHANGELOG_FILE" ]; then
+          echo "Error: Changelog file not found: $CHANGELOG_FILE"
           exit 1
         fi
         
-        echo "✅ Build zip: ${{ inputs.BUILD_ZIP_PATH }}"
-        echo "✅ Changelog: ${{ inputs.CHANGELOG_FILE }}"
+        echo "✅ Build zip: $BUILD_ZIP_PATH"
+        echo "✅ Changelog: $CHANGELOG_FILE"
     
     - name: Create GitHub release
       id: create-release
EOF
@@ -28,19 +28,22 @@
steps:
- name: Verify files exist
shell: bash
env:
BUILD_ZIP_PATH: ${{ inputs.BUILD_ZIP_PATH }}
CHANGELOG_FILE: ${{ inputs.CHANGELOG_FILE }}
run: |
if [ ! -f "${{ inputs.BUILD_ZIP_PATH }}" ]; then
echo "Error: Build zip file not found: ${{ inputs.BUILD_ZIP_PATH }}"
if [ ! -f "$BUILD_ZIP_PATH" ]; then
echo "Error: Build zip file not found: $BUILD_ZIP_PATH"
exit 1
fi

if [ ! -f "${{ inputs.CHANGELOG_FILE }}" ]; then
echo "Error: Changelog file not found: ${{ inputs.CHANGELOG_FILE }}"
if [ ! -f "$CHANGELOG_FILE" ]; then
echo "Error: Changelog file not found: $CHANGELOG_FILE"
exit 1
fi

echo "✅ Build zip: ${{ inputs.BUILD_ZIP_PATH }}"
echo "✅ Changelog: ${{ inputs.CHANGELOG_FILE }}"
echo "✅ Build zip: $BUILD_ZIP_PATH"
echo "✅ Changelog: $CHANGELOG_FILE"

- name: Create GitHub release
id: create-release
Copilot is powered by AI and may make mistakes. Always verify output.
echo "🚀 **Release Created Successfully!**"
echo "📋 **Release Details:**"
echo " - Version: v${{ inputs.PACKAGE_VERSION }}"
echo " - Pre-release: ${{ inputs.PRE_RELEASE }}"

Check warning

Code scanning / CodeQL

Code injection Medium

Potential code injection in
${ inputs.PRE_RELEASE }
, which may be controlled by an external user.

Copilot Autofix

AI 4 months ago

To fix this issue, we need to ensure that any user-controlled input (such as ${{ inputs.PRE_RELEASE }}) is not directly interpolated into the script with ${{ }} expression syntax. Instead, it should first be assigned to an environment variable using env: and then referenced with the shell's native variable expansion ($PRE_RELEASE). Specifically, assign PRE_RELEASE to an environment variable via the env key within the workflow step, and in the bash script, use "$PRE_RELEASE" instead of ${{ inputs.PRE_RELEASE }}. This change only needs to be applied to the step that outputs the release summary (the step beginning at line 59). No changes in business logic or function should occur, just a switch to safe variable expansion.

Required changes:

  • In the "Release summary" step, add an env: section assigning PRE_RELEASE: ${{ inputs.PRE_RELEASE }}.
  • On line 65, replace echo " - Pre-release: ${{ inputs.PRE_RELEASE }}" with echo " - Pre-release: $PRE_RELEASE" (i.e., use shell expansion).
  • No new imports or dependencies required.

Suggested changeset 1
.github/actions/create-theme-release-release/action.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/actions/create-theme-release-release/action.yml b/.github/actions/create-theme-release-release/action.yml
--- a/.github/actions/create-theme-release-release/action.yml
+++ b/.github/actions/create-theme-release-release/action.yml
@@ -58,11 +58,13 @@
     
     - name: Release summary
       shell: bash
+      env:
+        PRE_RELEASE: ${{ inputs.PRE_RELEASE }}
       run: |
         echo "🚀 **Release Created Successfully!**"
         echo "📋 **Release Details:**"
         echo "   - Version: v${{ inputs.PACKAGE_VERSION }}"
-        echo "   - Pre-release: ${{ inputs.PRE_RELEASE }}"
+        echo "   - Pre-release: $PRE_RELEASE"
         echo "   - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
         echo "   - Release URL: ${{ steps.create-release.outputs.html_url }}"
         echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV
EOF
@@ -58,11 +58,13 @@

- name: Release summary
shell: bash
env:
PRE_RELEASE: ${{ inputs.PRE_RELEASE }}
run: |
echo "🚀 **Release Created Successfully!**"
echo "📋 **Release Details:**"
echo " - Version: v${{ inputs.PACKAGE_VERSION }}"
echo " - Pre-release: ${{ inputs.PRE_RELEASE }}"
echo " - Pre-release: $PRE_RELEASE"
echo " - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
echo " - Release URL: ${{ steps.create-release.outputs.html_url }}"
echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV
Copilot is powered by AI and may make mistakes. Always verify output.
echo "📋 **Release Details:**"
echo " - Version: v${{ inputs.PACKAGE_VERSION }}"
echo " - Pre-release: ${{ inputs.PRE_RELEASE }}"
echo " - Build file: ${{ inputs.BUILD_ZIP_PATH }}"

Check warning

Code scanning / CodeQL

Code injection Medium

Potential code injection in
${ inputs.BUILD_ZIP_PATH }
, which may be controlled by an external user.

Copilot Autofix

AI 4 months ago

To fix this potential code injection vulnerability, the user-controlled input (BUILD_ZIP_PATH) should be passed to the shell script as an environment variable, rather than being directly interpolated into the script using ${{ ... }}. The correct pattern is to define an environment variable in the step (using env:), assign it the value from ${{ inputs.BUILD_ZIP_PATH }}, and then reference it inside the script using shell-native syntax ("$BUILD_ZIP_PATH"). This mitigates shell code injection risks. Lines 61-68 should be updated so that BUILD_ZIP_PATH and other user inputs used in echo and export statements are referenced from environment variables rather than interpolated directly. The environment variables can be set via the env: key of the step.

Suggested changeset 1
.github/actions/create-theme-release-release/action.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/actions/create-theme-release-release/action.yml b/.github/actions/create-theme-release-release/action.yml
--- a/.github/actions/create-theme-release-release/action.yml
+++ b/.github/actions/create-theme-release-release/action.yml
@@ -58,11 +58,16 @@
     
     - name: Release summary
       shell: bash
+      env:
+        PACKAGE_VERSION: ${{ inputs.PACKAGE_VERSION }}
+        PRE_RELEASE: ${{ inputs.PRE_RELEASE }}
+        BUILD_ZIP_PATH: ${{ inputs.BUILD_ZIP_PATH }}
+        RELEASE_URL: ${{ steps.create-release.outputs.html_url }}
       run: |
         echo "🚀 **Release Created Successfully!**"
         echo "📋 **Release Details:**"
-        echo "   - Version: v${{ inputs.PACKAGE_VERSION }}"
-        echo "   - Pre-release: ${{ inputs.PRE_RELEASE }}"
-        echo "   - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
-        echo "   - Release URL: ${{ steps.create-release.outputs.html_url }}"
-        echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV
+        echo "   - Version: v$PACKAGE_VERSION"
+        echo "   - Pre-release: $PRE_RELEASE"
+        echo "   - Build file: $BUILD_ZIP_PATH"
+        echo "   - Release URL: $RELEASE_URL"
+        echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV
EOF
@@ -58,11 +58,16 @@

- name: Release summary
shell: bash
env:
PACKAGE_VERSION: ${{ inputs.PACKAGE_VERSION }}
PRE_RELEASE: ${{ inputs.PRE_RELEASE }}
BUILD_ZIP_PATH: ${{ inputs.BUILD_ZIP_PATH }}
RELEASE_URL: ${{ steps.create-release.outputs.html_url }}
run: |
echo "🚀 **Release Created Successfully!**"
echo "📋 **Release Details:**"
echo " - Version: v${{ inputs.PACKAGE_VERSION }}"
echo " - Pre-release: ${{ inputs.PRE_RELEASE }}"
echo " - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
echo " - Release URL: ${{ steps.create-release.outputs.html_url }}"
echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV
echo " - Version: v$PACKAGE_VERSION"
echo " - Pre-release: $PRE_RELEASE"
echo " - Build file: $BUILD_ZIP_PATH"
echo " - Release URL: $RELEASE_URL"
echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV
Copilot is powered by AI and may make mistakes. Always verify output.
echo " - Version: v${{ inputs.PACKAGE_VERSION }}"
echo " - Pre-release: ${{ inputs.PRE_RELEASE }}"
echo " - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
echo " - Release URL: ${{ steps.create-release.outputs.html_url }}"

Check warning

Code scanning / CodeQL

Code injection Medium

Potential code injection in
${ steps.create-release.outputs.html_url }
, which may be controlled by an external user.

Copilot Autofix

AI 4 months ago

To mitigate the code injection risk, the recommended solution is to store the value of ${{ steps.create-release.outputs.html_url }} in an environment variable in the step, then reference that variable within the bash script using $RELEASE_URL (shell variable syntax) rather than ${{ ... }}. This avoids direct interpolation of potentially user-controlled values inside the shell command, preventing code injection. The required change is to add env: RELEASE_URL: ${{ steps.create-release.outputs.html_url }} to the step and replace the shell usage of ${{ steps.create-release.outputs.html_url }} with $RELEASE_URL in the relevant locations (line 67 and line 68). No extra dependencies or method definitions are required, just modifications in the YAML step configuration.

Suggested changeset 1
.github/actions/create-theme-release-release/action.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/actions/create-theme-release-release/action.yml b/.github/actions/create-theme-release-release/action.yml
--- a/.github/actions/create-theme-release-release/action.yml
+++ b/.github/actions/create-theme-release-release/action.yml
@@ -58,11 +58,13 @@
     
     - name: Release summary
       shell: bash
+      env:
+        RELEASE_URL: ${{ steps.create-release.outputs.html_url }}
       run: |
         echo "🚀 **Release Created Successfully!**"
         echo "📋 **Release Details:**"
         echo "   - Version: v${{ inputs.PACKAGE_VERSION }}"
         echo "   - Pre-release: ${{ inputs.PRE_RELEASE }}"
         echo "   - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
-        echo "   - Release URL: ${{ steps.create-release.outputs.html_url }}"
-        echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV
+        echo "   - Release URL: $RELEASE_URL"
+        echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV
EOF
@@ -58,11 +58,13 @@

- name: Release summary
shell: bash
env:
RELEASE_URL: ${{ steps.create-release.outputs.html_url }}
run: |
echo "🚀 **Release Created Successfully!**"
echo "📋 **Release Details:**"
echo " - Version: v${{ inputs.PACKAGE_VERSION }}"
echo " - Pre-release: ${{ inputs.PRE_RELEASE }}"
echo " - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
echo " - Release URL: ${{ steps.create-release.outputs.html_url }}"
echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV
echo " - Release URL: $RELEASE_URL"
echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV
Copilot is powered by AI and may make mistakes. Always verify output.
echo " - Pre-release: ${{ inputs.PRE_RELEASE }}"
echo " - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
echo " - Release URL: ${{ steps.create-release.outputs.html_url }}"
echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV

Check warning

Code scanning / CodeQL

Code injection Medium

Potential code injection in
${ steps.create-release.outputs.html_url }
, which may be controlled by an external user.

Copilot Autofix

AI 4 months ago

To resolve the code injection risk, the workflow should avoid directly interpolating ${{ steps.create-release.outputs.html_url }} into the shell script. Instead, set it first as an environment variable via the env: field of the step, then reference it using standard shell variable syntax ($RELEASE_URL) when writing to $GITHUB_ENV. This change is limited to the "Release summary" step: define an environment variable RELEASE_URL set to ${{ steps.create-release.outputs.html_url }} in the step definition and then reference it as $RELEASE_URL within the shell script on line 68. No other lines need to be changed.

Suggested changeset 1
.github/actions/create-theme-release-release/action.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/actions/create-theme-release-release/action.yml b/.github/actions/create-theme-release-release/action.yml
--- a/.github/actions/create-theme-release-release/action.yml
+++ b/.github/actions/create-theme-release-release/action.yml
@@ -58,11 +58,13 @@
     
     - name: Release summary
       shell: bash
+      env:
+        RELEASE_URL: ${{ steps.create-release.outputs.html_url }}
       run: |
         echo "🚀 **Release Created Successfully!**"
         echo "📋 **Release Details:**"
         echo "   - Version: v${{ inputs.PACKAGE_VERSION }}"
         echo "   - Pre-release: ${{ inputs.PRE_RELEASE }}"
         echo "   - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
-        echo "   - Release URL: ${{ steps.create-release.outputs.html_url }}"
-        echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV
+        echo "   - Release URL: $RELEASE_URL"
+        echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV
EOF
@@ -58,11 +58,13 @@

- name: Release summary
shell: bash
env:
RELEASE_URL: ${{ steps.create-release.outputs.html_url }}
run: |
echo "🚀 **Release Created Successfully!**"
echo "📋 **Release Details:**"
echo " - Version: v${{ inputs.PACKAGE_VERSION }}"
echo " - Pre-release: ${{ inputs.PRE_RELEASE }}"
echo " - Build file: ${{ inputs.BUILD_ZIP_PATH }}"
echo " - Release URL: ${{ steps.create-release.outputs.html_url }}"
echo "RELEASE_URL=${{ steps.create-release.outputs.html_url }}" >> $GITHUB_ENV
echo " - Release URL: $RELEASE_URL"
echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV
Copilot is powered by AI and may make mistakes. Always verify output.
- name: Create GitHub Release (Actual)
if: ${{ inputs.dry_run == false }}
id: create-release
uses: softprops/action-gh-release@v1

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Release Preparation (Hello Elementor)' step
Uses Step: create-release
uses 'softprops/action-gh-release' with ref 'v1', not a pinned commit hash
@hein-obox hein-obox force-pushed the internal/TMZ-803-clone-release-workflow branch from 2c69f3b to cf085eb Compare September 4, 2025 12:11
- Add execute permissions to Hello Theme shell scripts
- Resolves potential workflow execution issues
- Standard best practice for .sh files in repositories

Scripts updated:
- commit-push-bump.sh
- create-git-tag.sh
- get-release-branch-name.sh
- set-git-user.sh
- sync-branches.sh
@hein-obox hein-obox requested a review from nicoladj77 September 4, 2025 12:29
@hein-obox hein-obox merged commit 6adb123 into main Sep 4, 2025
42 checks passed
@hein-obox hein-obox deleted the internal/TMZ-803-clone-release-workflow branch September 4, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants