Skip to content
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Exports secrets to a file in your `GITHUB_WORKSPACE`, useful for applications th
env-slug: "dev"
project-slug: "cli-integration-tests-9-edj"
export-type: "file"
file-output-path: "/src/.env" # defaults to "/.env"
file-output-path: "/src/.env" # Path relative to GITHUB_WORKSPACE; leading slashes will be stripped
```

**Note**: Make sure to configure an `actions/checkout` step before using this action in file export mode
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import core from "@actions/core";
import { UALogin, getRawSecrets, oidcLogin } from "./infisical.js";
import fs from "fs/promises";
import path from "path";

try {
const method = core.getInput("method");
Expand Down Expand Up @@ -79,7 +80,7 @@ try {
.join("\n");

try {
const filePath = `${process.env.GITHUB_WORKSPACE}${fileOutputPath}`;
const filePath = path.join(process.env.GITHUB_WORKSPACE, fileOutputPath.replace(/^\/+/, ""));
Comment thread
coderabbitai[bot] marked this conversation as resolved.
core.info(`Exporting secrets to ${filePath}`);
await fs.writeFile(filePath, fileContent);
} catch (err) {
Expand Down