Skip to content

Commit d8acf17

Browse files
author
Amelia Wattenbeger
committed
can I just updateFile ?
1 parent 4547b4f commit d8acf17

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19525,15 +19525,14 @@ var main = async () => {
1952519525
data
1952619526
}));
1952719527
const outputFile = core.getInput("output_file") || "./diagram.svg";
19528-
await import_fs2.default.writeFileSync(outputFile, componentCodeString);
19529-
await octokit.repos.createStatus({
19528+
await octokit.repo.updateFile({
1953019529
owner: repo.owner.login,
1953119530
repo: repo.name,
19531+
path: outputFile,
19532+
content: componentCodeString,
1953219533
sha: context.sha,
19533-
state: "success",
19534-
target_url: `${context.base_url}/${outputFile}`,
19535-
description: "Repo visualizer: updated diagram",
19536-
context: "Repo visualizer: updated diagram"
19534+
message: "Repo visualizer: updated diagram",
19535+
branch: context.branch
1953719536
});
1953819537
console.log("All set!");
1953919538
};

src/index.jsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,20 @@ const main = async () => {
3535

3636
const outputFile = core.getInput("output_file") || "./diagram.svg"
3737

38-
await fs.writeFileSync(outputFile, componentCodeString)
38+
// await fs.writeFileSync(outputFile, componentCodeString)
3939

4040

4141
// add outputFile to git
4242
// await execWithOutput('git', ['add', outputFile])
4343

44-
45-
46-
await octokit.repos.createStatus({
44+
await octokit.repo.updateFile({
4745
owner: repo.owner.login,
4846
repo: repo.name,
47+
path: outputFile,
48+
content: componentCodeString,
4949
sha: context.sha,
50-
state: 'success',
51-
target_url: `${context.base_url}/${outputFile}`,
52-
description: 'Repo visualizer: updated diagram',
53-
context: 'Repo visualizer: updated diagram',
50+
message: 'Repo visualizer: updated diagram',
51+
branch: context.branch
5452
})
5553
// await exec('git', ['add', outputFile])
5654
// const diff = await execWithOutput('git', ['status', '--porcelain', outputFile])

0 commit comments

Comments
 (0)