From 956c3402268444c63fc28863538735b3744c9a4b Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sat, 23 Jan 2021 20:09:56 +0200 Subject: [PATCH] Update uncivbot.yml --- .github/workflows/uncivbot.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/uncivbot.yml b/.github/workflows/uncivbot.yml index 4ad566fbb8..387aa8f384 100644 --- a/.github/workflows/uncivbot.yml +++ b/.github/workflows/uncivbot.yml @@ -82,17 +82,21 @@ jobs: async function createTranslationBranchIfNeeded() { if (await branchExists(translations)) return var defaultBranch = await getDefaultBranch() + var currentHead = await github.git.getRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'heads/' + defaultBranch }) + var currentSha = currentHead.data.object.sha console.log("Current sha: " + currentSha) + await github.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, ref: `refs/heads/`+translations, sha: currentSha }) + await github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, @@ -106,7 +110,8 @@ jobs: repo: context.repo.repo, state: "open", }) - translationPrs.forEach(pr => { console.log(pr) }) + + translationPrs.data.forEach(pr => { console.log(pr) }) }