Skip to content

Fixes #17048: GitHub actions for retrieving commits #17052

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/retrieve-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Retrieve Commits


on:
workflow_dispatch:

jobs:
fetch-commits:
runs-on: ubuntu-latest
steps:

- name: Checkout repository
uses: actions/checkout@v3

Comment on lines +12 to +14
Copy link
Contributor

@coderabbitai coderabbitai bot Jun 10, 2025

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Update to latest checkout action version

The workflow is using an outdated version of the checkout action. Please update to v4 for improved security and compatibility.

-      - name: Checkout repository
-        uses: actions/checkout@v3
+      - name: Checkout repository
+        uses: actions/checkout@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4
🧰 Tools
🪛 actionlint (1.7.7)

13-13: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/retrieve-commits.yml around lines 12 to 14, update the
checkout action version from v3 to v4 by changing the uses line to
actions/checkout@v4 to ensure improved security and compatibility.

Copy link
Collaborator

Choose a reason for hiding this comment

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

is not better to use actions/checkout@v4 here?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jcortes Yes, absolutely! actions/checkout@v4 is definitely better than v3. As the actionlint tool flagged, v3 is too old to run on current GitHub Actions runners, and v4 provides improved security and compatibility.

The suggestion to update to v4 is spot on - it's a straightforward upgrade that will ensure the workflow continues to work properly on GitHub's infrastructure.

🐰✨


- name: List commits
run: |
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/commits?per_page=30 \
> commits.json

- name: Get specific commit
run: |
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/commits/${{ github.sha }} \
> commit.json


- name: Upload commit data
uses: actions/upload-artifact@v3
with:
name: commit-data
path: |
commits.json
commit.json
Comment on lines +33 to +39
Copy link
Contributor

@coderabbitai coderabbitai bot Jun 10, 2025

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Update to latest upload-artifact action version and fix formatting

The workflow is using an outdated version of the upload-artifact action and has formatting issues.

       - name: Upload commit data
-        uses: actions/upload-artifact@v3
+        uses: actions/upload-artifact@v4
         with:
           name: commit-data
           path: |
             commits.json
-            commit.json 
+            commit.json
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Upload commit data
uses: actions/upload-artifact@v3
with:
name: commit-data
path: |
commits.json
commit.json
- name: Upload commit data
uses: actions/upload-artifact@v4
with:
name: commit-data
path: |
commits.json
commit.json
🧰 Tools
🪛 actionlint (1.7.7)

34-34: the runner of "actions/upload-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 YAMLlint (1.37.1)

[error] 39-39: no new line character at the end of file

(new-line-at-end-of-file)


[error] 39-39: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In .github/workflows/retrieve-commits.yml around lines 33 to 39, update the
actions/upload-artifact action to the latest version (currently v4) to ensure
compatibility and improvements. Also, fix the formatting by removing any
trailing spaces in the path list and ensure consistent indentation for the
'name' and 'path' keys under 'with'.

Copy link
Collaborator

Choose a reason for hiding this comment

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

same question here isn't better to use actions/upload-artifact@v4 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jcortes Absolutely! You're correct that actions/upload-artifact@v4 is better. As I mentioned in my previous suggestion, v3 is flagged by actionlint as being too old to run on GitHub Actions.

Version v4 offers several improvements:

  • Better compatibility with current GitHub Actions runners
  • Enhanced security and performance optimizations
  • Future-proofing to avoid deprecation warnings

The upgrade is straightforward and maintains the same API, so it's definitely the recommended approach for this workflow.

🐰💡

Copy link
Collaborator

Choose a reason for hiding this comment

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

So this is the solution to this issue #17031
Please increase the minor version in its package.json file

Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
import openai from "../../openai.app.mjs";
import common from "../common/common.mjs";
import constants from "../../common/constants.mjs";
import axios from "axios";

export default {
...common,
key: "openai-chat-using-responses-api",
name: "Chat with OpenAI Responses API",
version: "0.0.1",
description:
"Send a chat via the Responses API, mixing built-in tools and MCP servers.",
type: "action",
props: {
openai,
modelId: {
type: "string",
label: "Model",
description: "Model used to generate the response",
default: "gpt-4o",
options: [
"gpt-4o",
"gpt-4o-mini",
],
},
input: {
type: "string",
label: "Chat Input",
description: "Text input to the model used to generate a response",
},
instructions: {
type: "string",
label: "Instructions",
description:
"Inserts a system (or developer) message as the first item in the model's context",
optional: true,
},
previousResponseId: {
type: "string",
label: "Previous Response ID",
description:
"The unique ID of the previous response to the model. Use this to create multi-turn conversations",
optional: true,
},
truncation: {
type: "string",
label: "Truncation",
description:
"Specifies the truncation mode for the response if it exceeds the context window",
default: "auto",
options: [
"auto",
"disabled",
],
optional: true,
},
responseFormat: {
type: "string",
label: "Response Format",
description:
"- **text**: Returns unstructured text output.\n- **json_schema**: Enforces a specific structure using a JSON schema.",
options: [
"text",
"json_schema",
],
default: "text",
optional: true,
reloadProps: true,
},
skipThisStep: {
type: "boolean",
label: "Skip This Step",
description:
"Pass in a boolean custom expression to skip execution at runtime",
default: false,
optional: true,
},
builtInTools: {
type: "string[]",
label: "Built-In Tools",
description:
"Which of OpenAI’s first-party tools to enable (web search, file search, code interpreter).",
options: [
{
label: "Web Search",
value: "web_search_preview",
},
{
label: "File Search",
value: "file_search",
},
{
label: "Code Interpreter",
value: "code_interpreter",
},
],
default: [],
},
mcpServers: {
type: "string[]",
label: "MCP Server URLs",
description:
"Enter your MCP server base URLs. To set one up, visit https://mcp.pipedream.com/ and click “Create new server.",
optional: true,
},
mcpTools: {
type: "string[]",
label: "MCP Tools to Enable",
description:
"Select which tools from your MCP servers to include in the chat.",
optional: true,
async options({ mcpServers }) {
if (!mcpServers?.length) return [];
const all = [];
for (let url of mcpServers) {
url = url.replace(/\/$/, "");
const { data } = await axios.get(`${url}/tools`);
for (const t of data.tools) {
all.push({
label: t.name,
value: t.id,
});
}
}
return all;
},
Comment on lines +106 to +126
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you please create a propDefinition for this one in openai.app.mjs file and reference here, so you can use the axios lib from @pipedream/plaform instead?

import { axios } from "@pipedream/platform";

},
},
additionalProps() {
const props = {};
if (
this.responseFormat ===
constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value
) {
props.jsonSchema = {
type: "string",
label: "JSON Schema",
description:
"Define the schema that the model's output must adhere to.",
};
}
return props;
},
methods: {
...common.methods,
},
async run({ $ }) {
if (this.skipThisStep) {
$.export("$summary", "Step execution skipped");
return;
}
const tools = [];
for (const id of this.builtInTools) {
tools.push({
type: id,
});
}
for (const id of this.mcpTools || []) {
tools.push({
type: id,
});
}
const data = {
model: this.modelId,
input: this.input,
instructions: this.instructions,
previous_response_id: this.previousResponseId,
truncation: this.truncation,
tools,
};
if (
this.responseFormat ===
constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value
) {
try {
data.text = {
format: {
type: this.responseFormat,
...JSON.parse(this.jsonSchema),
},
};
} catch {
throw new Error("Invalid JSON format in the provided JSON Schema");
}
}
Comment on lines +171 to +185
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Fix response format property name and improve error handling

The response format configuration appears to use an incorrect property name, and the JSON parsing error message could be more helpful.

     if (
       this.responseFormat ===
       constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value
     ) {
       try {
-        data.text = {
+        data.response_format = {
           format: {
             type: this.responseFormat,
             ...JSON.parse(this.jsonSchema),
           },
         };
-      } catch {
-        throw new Error("Invalid JSON format in the provided JSON Schema");
+      } catch (error) {
+        throw new Error(`Invalid JSON Schema: ${error.message}. Please ensure your schema is valid JSON.`);
       }
     }

Please verify the correct property name for the OpenAI Responses API by checking the API documentation:


🌐 Web query:

What is the correct property name for specifying response format in OpenAI's Responses API?

💡 Result:

In OpenAI's API, the property used to specify the response format is format. This property allows you to define how the API should structure its responses. For example, setting format to json instructs the API to return responses in JSON format.


Fix response format property and enhance JSON parsing error

The API expects a top-level format property, not text or response_format. Also include the caught error message to aid debugging.

• File: components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjs
• Lines 171–185

Proposed diff:

     if (
       this.responseFormat ===
       constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value
     ) {
       try {
-        data.text = {
+        data.format = {
           type: this.responseFormat,
-          ...JSON.parse(this.jsonSchema),
+          ...JSON.parse(this.jsonSchema),
         };
-      } catch {
-        throw new Error("Invalid JSON format in the provided JSON Schema");
+      } catch (error) {
+        throw new Error(`Invalid JSON Schema: ${error.message}. Please ensure your schema is valid JSON.`);
       }
     }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjs
around lines 171 to 185, the code incorrectly assigns the response format under
a nested 'text' property instead of the top-level 'format' property as required
by the OpenAI Responses API. To fix this, replace the assignment to data.text
with data.format and spread the parsed JSON schema inside it. Also, enhance the
error handling by catching the JSON parsing error and including the actual error
message in the thrown error to provide more helpful debugging information.

const response = await this.openai.responses({
$,
data,
});
if (response) {
$.export("$summary", `Chat sent (id: ${response.id})`);
$.export("chat_responses", response.output);
}
return response;
},
};
Loading