From c0398ebaa4697adf6006931bf8d7896ae1ee6c69 Mon Sep 17 00:00:00 2001 From: awwpotato Date: Wed, 4 Jun 2025 08:36:45 -0700 Subject: [PATCH] ci: add 'has: port to stable' label for backports (#1367) Link: https://github.com/nix-community/stylix/pull/1367 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- .github/workflows/backport.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 717035c1..0cb9d14d 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -7,7 +7,9 @@ on: pull_request_target: types: [closed, labeled] -permissions: {} +permissions: + contents: read + pull-requests: write jobs: backport: @@ -45,3 +47,17 @@ jobs: label_pattern: "^backport: ([^ ]+)$" pull_title: "[${target_branch}] ${pull_title}" pull_description: "This is an automated backport of #${pull_number}." + + - name: "Add 'has: port to stable' label" + if: steps.backport.outputs.created_pull_numbers != '' + env: + # Not the app on purpose to avoid triggering another workflow run + # after adding this label + GH_TOKEN: ${{ github.token }} + REPOSITORY: ${{ github.repository }} + NUMBER: ${{ github.event.number }} + run: | + gh api \ + --method POST \ + /repos/"$REPOSITORY"/issues/"$NUMBER"/labels \ + -f "labels[]=has: port to stable"