From 1118e1ae71596f7c7deb6773ffe55413085f8e63 Mon Sep 17 00:00:00 2001 From: YanisBft Date: Thu, 17 Jun 2021 09:59:31 +0200 Subject: [PATCH] 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 0f98f227f63e9615f83d3f5462612c86f584b4db. * there is probably a better solution --- .github/workflows/update-base.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/update-base.yml b/.github/workflows/update-base.yml index 7107a46337..24d383b7b1 100644 --- a/.github/workflows/update-base.yml +++ b/.github/workflows/update-base.yml @@ -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) {