Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
grassedge committed Dec 24, 2019
1 parent c9cb98c commit fa62fe0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: generate plantuml
on: push
on:
push:
branches:
- master
jobs:
generate_plantuml:
runs-on: ubuntu-latest
Expand Down
9 changes: 5 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4402,19 +4402,20 @@ const octokit = new github.GitHub(process.env.GITHUB_TOKEN);
}
const treeRes = yield octokit.git.createTree({
owner, repo, tree,
base_tree: commits[0].tree.sha,
base_tree: commits[commits.length - 1].commit.tree.sha,
});
const createdCommitRes = yield octokit.git.createCommit({
owner, repo,
message: `Generate svg files`,
parents: [commits[0].sha],
parents: [commits[commits.length - 1].sha],
tree: treeRes.data.sha,
});
const updatedRefRes = yield octokit.git.updateRef({
owner, repo, ref,
owner, repo,
ref: ref.replace(/^refs\//, ''),
sha: createdCommitRes.data.sha,
});
console.log(`${tree.map(t => t.path).join("\n")} Abobe files are generated.`);
console.log(`${tree.map(t => t.path).join("\n")}\nAbobe files are generated.`);
});
})().catch(e => {
core.setFailed(e);
Expand Down
10 changes: 5 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ if (!process.env.GITHUB_TOKEN) {
const octokit = new github.GitHub(process.env.GITHUB_TOKEN);

(async function main() {

const payload = github.context.payload;
const ref = payload.ref;
if (!payload.repository) {
Expand Down Expand Up @@ -89,22 +88,23 @@ const octokit = new github.GitHub(process.env.GITHUB_TOKEN);

const treeRes = await octokit.git.createTree({
owner, repo, tree,
base_tree: commits[0].tree.sha,
base_tree: commits[commits.length - 1].commit.tree.sha,
});

const createdCommitRes = await octokit.git.createCommit({
owner, repo,
message: `Generate svg files`,
parents: [ commits[0].sha ],
parents: [ commits[commits.length - 1].sha ],
tree: treeRes.data.sha,
});

const updatedRefRes = await octokit.git.updateRef({
owner, repo, ref,
owner, repo,
ref: ref.replace(/^refs\//, ''),
sha: createdCommitRes.data.sha,
});

console.log(`${tree.map(t => t.path).join("\n")} Abobe files are generated.`);
console.log(`${tree.map(t => t.path).join("\n")}\nAbobe files are generated.`);
})().catch(e => {
core.setFailed(e);
});

0 comments on commit fa62fe0

Please sign in to comment.