mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Update uncivbot.yml
This commit is contained in:
parent
66dee1ae0d
commit
06240ba402
13
.github/workflows/uncivbot.yml
vendored
13
.github/workflows/uncivbot.yml
vendored
@ -60,7 +60,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@v3
|
- uses: actions/github-script@v3
|
||||||
with:
|
with:
|
||||||
# github-token: ${{secrets.GITHUB_TOKEN}}
|
# SO, the story is that when using the default access token you CANNOT merge PRs from forks.
|
||||||
|
# _Badly_ documented in multiple places, including here: https://docs.github.com/en/actions/reference/authentication-in-a-workflow
|
||||||
|
# To get around this, we created a Personal Access Token,
|
||||||
|
# put it as one of the secrets in the repo settings (https://github.com/yairm210/Unciv/settings/secrets/actions),
|
||||||
|
# and use that instead.
|
||||||
github-token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
|
github-token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
async function branchExists(branchName) {
|
async function branchExists(branchName) {
|
||||||
@ -114,10 +118,13 @@ jobs:
|
|||||||
state: "open"
|
state: "open"
|
||||||
})
|
})
|
||||||
|
|
||||||
translationPrs.data.forEach(async pr => {
|
// When we used a forEach loop here, only one merge would happen at each run,
|
||||||
|
// because we essentially started multiple async tasks in parallel and they conflicted.
|
||||||
|
// Instead, we use X of Y as per https://stackoverflow.com/questions/37576685/using-async-await-with-a-foreach-loop
|
||||||
|
for (const pr of translationPrs.data) {
|
||||||
if (pr.labels.some(label => label.name == "mergeable translation"))
|
if (pr.labels.some(label => label.name == "mergeable translation"))
|
||||||
await tryMergePr(pr)
|
await tryMergePr(pr)
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function tryMergePr(pr){
|
async function tryMergePr(pr){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user