Add and remove release/snapshot labels when updating branch (#2484)

* Update update-base.yml

* forgot i'm stupid

* Revert "forgot i'm stupid"

This reverts commit 0f98f227f6.

* there is probably a better solution
This commit is contained in:
YanisBft 2021-06-17 09:59:31 +02:00 committed by GitHub
parent 62a05f3c86
commit 1118e1ae71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -33,6 +33,17 @@ jobs:
try {
// Updates the pull request with the latest upstream changes.
await github.pulls.updateBranch({ owner, repo, pull_number })
// Checks if the branch is a development version
if (contains(base, '-') || contains(base, 'w')) {
await github.issues.addLabels({ owner, repo, issue_number, labels: ['snapshot'] });
await github.issues.removeLabel({ owner, repo, issue_number, name: 'release' });
// Otherwise it's a release
} else {
await github.issues.addLabels({ owner, repo, issue_number, labels: ['release'] });
await github.issues.removeLabel({ owner, repo, issue_number, name: 'snapshot' });
}
} catch (error) {
// 422 is returned when there is a merge conflict
if (error.status === 422) {