Skip to content

Commit

Permalink
0.15.0: Fixed ingested filenames wrongly displayed in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
flavienbwk committed Sep 9, 2024
1 parent d7ef81d commit a447e35
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
repository-projects: write
packages: write
steps:
- uses: actions/checkout@v2
- uses: ./
Expand Down
10 changes: 5 additions & 5 deletions action/utils/fileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function sendFileToApi(filePath, apiUrl, ingestSecret) {
const payload = { 'content': content, 'metadata': metadata };

try {
console.log(`Sending: $action/utils/fileUtils.js`);
console.log(`Sending: ${filePath}`);
const response = await axios.post(apiUrl, payload, { headers: { 'Content-Type': 'application/json', 'X-Ingest-Secret': ingestSecret } });
return response;
} catch (error) {
Expand All @@ -29,12 +29,12 @@ async function sendFileToApi(filePath, apiUrl, ingestSecret) {
}

async function processFile(filePath, apiUrl, ingestSecret) {
console.log(`Sending file: $action/utils/fileUtils.js`);
console.log(`Sending file: ${filePath}`);
const response = await sendFileToApi(filePath, apiUrl, ingestSecret);
if (response.status === 200) {
console.log(`Successfully ingested: $action/utils/fileUtils.js`);
console.log(`Successfully ingested: ${filePath}`);
} else {
console.log(`Failed to ingest $action/utils/fileUtils.js. Status code: ${response.status}`);
console.log(`Failed to ingest ${filePath}. Status code: ${response.status}`);
}
}

Expand Down Expand Up @@ -66,7 +66,7 @@ async function ingestFiles(directoryPath, apiUrl, ingestSecret, excludeFiles = [
} else if (isValidFile(filePath) && !isExcluded(filePath, excludeFiles)) {
await processFile(filePath, apiUrl, ingestSecret);
} else {
console.log(`Skipping invalid, hidden, or excluded file: $action/utils/fileUtils.js`);
console.log(`Skipping invalid, hidden, or excluded file: ${filePath}`);
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28938,7 +28938,7 @@ async function sendFileToApi(filePath, apiUrl, ingestSecret) {
const payload = { 'content': content, 'metadata': metadata };

try {
console.log(`Sending: $action/utils/fileUtils.js`);
console.log(`Sending: ${filePath}`);
const response = await axios.post(apiUrl, payload, { headers: { 'Content-Type': 'application/json', 'X-Ingest-Secret': ingestSecret } });
return response;
} catch (error) {
Expand All @@ -28948,12 +28948,12 @@ async function sendFileToApi(filePath, apiUrl, ingestSecret) {
}

async function processFile(filePath, apiUrl, ingestSecret) {
console.log(`Sending file: $action/utils/fileUtils.js`);
console.log(`Sending file: ${filePath}`);
const response = await sendFileToApi(filePath, apiUrl, ingestSecret);
if (response.status === 200) {
console.log(`Successfully ingested: $action/utils/fileUtils.js`);
console.log(`Successfully ingested: ${filePath}`);
} else {
console.log(`Failed to ingest $action/utils/fileUtils.js. Status code: ${response.status}`);
console.log(`Failed to ingest ${filePath}. Status code: ${response.status}`);
}
}

Expand Down Expand Up @@ -28985,7 +28985,7 @@ async function ingestFiles(directoryPath, apiUrl, ingestSecret, excludeFiles = [
} else if (isValidFile(filePath) && !isExcluded(filePath, excludeFiles)) {
await processFile(filePath, apiUrl, ingestSecret);
} else {
console.log(`Skipping invalid, hidden, or excluded file: $action/utils/fileUtils.js`);
console.log(`Skipping invalid, hidden, or excluded file: ${filePath}`);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gh-action-repochat",
"version": "0.14.0",
"version": "0.15.0",
"type": "commonjs",
"description": "GitHub Action to run repochat",
"main": "index.js",
Expand Down

0 comments on commit a447e35

Please sign in to comment.