Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/OctoPrint/OctoPrint.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGina Häußge <gina@octoprint.org>2021-09-14 19:55:46 +0300
committerGina Häußge <gina@octoprint.org>2021-09-14 19:55:46 +0300
commit5f7679b11baafc0bb58861c462b9e4568041080b (patch)
tree6230e5c3c6e1f3acb07e60cbdd02a6a9518f07f2 /.github
parent0e1ada7a0e8445a86da329ebd222fa03020c6e90 (diff)
👷 Add target branch labels to PRs
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/pr_automation.yml23
1 files changed, 23 insertions, 0 deletions
diff --git a/.github/workflows/pr_automation.yml b/.github/workflows/pr_automation.yml
index d0e04b09b..c1f115ecf 100644
--- a/.github/workflows/pr_automation.yml
+++ b/.github/workflows/pr_automation.yml
@@ -12,6 +12,29 @@ jobs:
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
+ - uses: actions/github-script@v2
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ let labels = [];
+ let setLabels = false;
+ context.payload.pull_request.labels.forEach(label => { labels.push(label.name) });
+
+ let target = context.payload.pull_request.base.ref;
+ if (["maintenance", "devel", "staging/maintenance", "staging/devel", "master"].includes(target)) {
+ labels.push(`targets ${target}`);
+ setLabels = true;
+ }
+
+ if (setLabels) {
+ github.issues.setLabels({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ labels: labels
+ })
+ }
+
- uses: OctoPrint/actions/pr-validation@main
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}