Skip to content

Conversation

@haimn-support
Copy link
Contributor

@haimn-support haimn-support commented Oct 22, 2025

User description

Description

I have modified docs/guides/all/scaffold-a-new-service.md to change add another step so that the github workflow will now handle the runId that it gets from Port self-service action correctly.
I have removed line 334 in the existing file and replace it with additions to lines 337-341 :

     - name: Extract runId from port_context
        run: |
          echo "PORT_RUN_ID=$(echo '${{ inputs.port_context }}' | jq -r .runId)" >> $GITHUB_ENV

This is due to the fact that when i run the workflow in the documents i could not run the self service action due to workflow issue with line 334

Added docs pages

Updated docs pages

Please also include the path for the updated docs

  • Scaffold a new service (/guides/all/scaffold-a-new-service/)

PR Type

Bug fix, Documentation


Description

  • Replace direct port_context runId extraction with jq parsing step

  • Move PORT_RUN_ID extraction from env to workflow step

  • Fix GitHub Actions workflow self-service action execution issue

  • Update scaffold service documentation with corrected workflow syntax


Diagram Walkthrough

flowchart LR
  A["Direct env extraction<br/>PORT_RUN_ID: fromJson"] -- "replaced by" --> B["jq parsing step<br/>Extract runId to GITHUB_ENV"]
  B -- "fixes" --> C["Self-service action<br/>execution issue"]
Loading

File Walkthrough

Relevant files
Bug fix
scaffold-a-new-service.md
Replace direct runId extraction with jq parsing step         

docs/guides/all/scaffold-a-new-service.md

  • Removed direct PORT_RUN_ID extraction from env section using
    fromJson(inputs.port_context).runId
  • Added new workflow step to extract runId using jq command and set it
    to GITHUB_ENV
  • Changed extraction method from inline JSON parsing to shell command
    with jq utility
  • Fixes workflow execution issue when running self-service actions from
    Port
+5/-2     

@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Oct 22, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Missing dependency

Description: Using jq in a GitHub Actions step without ensuring jq is available on the runner may cause
step failure; verify runner image includes jq or add an installation step to avoid
breaking the workflow.
scaffold-a-new-service.md [338-340]

Referred Code
- name: Extract runId from port_context
  run: |
    echo "PORT_RUN_ID=$(echo '${{ inputs.port_context }}' | jq -r .runId)" >> $GITHUB_ENV
Ticket Compliance
🎫 No ticket provided
- [ ] Create ticket/issue <!-- /create_ticket --create_ticket=true -->

</details></td></tr>
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Oct 22, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Security
Prevent shell injection from input

To prevent a potential shell injection vulnerability, pass the
inputs.port_context to the run step as an environment variable instead of
directly interpolating it into the shell command.

docs/guides/all/scaffold-a-new-service.md [338-340]

 - name: Extract runId from port_context
+  env:
+    PORT_CONTEXT: ${{ inputs.port_context }}
   run: |
-    echo "PORT_RUN_ID=$(echo '${{ inputs.port_context }}' | jq -r .runId)" >> $GITHUB_ENV
+    echo "PORT_RUN_ID=$(echo "$PORT_CONTEXT" | jq -r .runId)" >> $GITHUB_ENV
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a critical shell injection vulnerability in the newly added workflow step and proposes a fix that aligns with security best practices for GitHub Actions.

High
  • Update

@aws-amplify-eu-west-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2936.d2ngvl90zqbob8.amplifyapp.com

@hadar-co hadar-co merged commit 1a85708 into main Oct 22, 2025
5 checks passed
@hadar-co hadar-co deleted the fix-scaffold-new-service-github-workflow branch October 22, 2025 16:34
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.

3 participants