From 6aa786fffa5c1e91f7f0d5fe7b44bae92776f255 Mon Sep 17 00:00:00 2001 From: Vacha Shah Date: Thu, 3 Feb 2022 16:39:59 -0800 Subject: [PATCH 1/2] Updating backport workflow to include custom branch name Signed-off-by: Vacha Shah --- .github/workflows/backport.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index c0d07fef8..7937acadf 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,6 +1,6 @@ name: Backport on: - pull_request: + pull_request_target: types: - closed - labeled @@ -8,9 +8,13 @@ on: jobs: backport: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write name: Backport steps: - name: Backport - uses: tibdex/backport@v1 + uses: VachaShah/backport@v1.1.4 with: github_token: ${{ secrets.GITHUB_TOKEN }} + branch_name: backport/backport-${{ github.event.number }} From 532856db1fb21325006f8433c9b1cfb8ba44a96f Mon Sep 17 00:00:00 2001 From: Vacha Shah Date: Thu, 10 Feb 2022 18:52:16 -0800 Subject: [PATCH 2/2] Using Github App to trigger CI on backport PRs Signed-off-by: Vacha Shah --- .github/workflows/backport.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 7937acadf..e47d8d88c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -13,8 +13,16 @@ jobs: pull-requests: write name: Backport steps: + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.5.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + - name: Backport uses: VachaShah/backport@v1.1.4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ steps.github_app_token.outputs.token }} branch_name: backport/backport-${{ github.event.number }}