Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit e0d48b1

Browse files
authored
Migrate to backport-action (#1975)
Remove dependency on outdated backport-bot-action
1 parent 9b80d79 commit e0d48b1

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

.github/workflows/backport-trigger.yml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,34 @@ on:
55
types: [created]
66

77
jobs:
8-
launchBackportBuild:
8+
setupBackport:
99
runs-on: ubuntu-latest
10-
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '@gitbot')
11-
10+
if: github.event.issue.pull_request != '' && startswith(github.event.comment.body, '@gitbot backport')
11+
outputs:
12+
target_branch: ${{ steps.parse_comment.outputs.target_branch }}
1213
steps:
13-
- uses: xamarin/[email protected]
14-
with:
15-
pull_request_url: ${{ github.event.issue.pull_request.url }}
16-
comment_body: ${{ github.event.comment.body }}
17-
comment_author: ${{ github.actor }}
18-
github_repository: ${{ github.repository }}
19-
ado_organization: ${{ secrets.ADO_PROJECTCOLLECTION }}
20-
ado_project: ${{ secrets.ADO_PROJECT }}
21-
backport_pipeline_id: ${{ secrets.BACKPORT_PIPELINEID }}
22-
ado_build_pat: ${{ secrets.ADO_BUILDPAT }}
23-
github_account_pat: ${{ secrets.SERVICEACCOUNT_PAT }}
24-
use_fork: 'false'
14+
- name: Parse Comment
15+
id: parse_comment
16+
run: |
17+
Write-Host "Parsing $env:COMMENT"
18+
($botName, $backport, $backportTargetBranch) = [System.Text.RegularExpressions.Regex]::Split("$env:COMMENT", "\s+")
19+
echo "::set-output name=target_branch::$backportTargetBranch"
20+
shell: pwsh
21+
env:
22+
COMMENT: "${{ github.event.comment.body }}"
23+
24+
launchBackportBuild:
25+
needs: setupBackport
26+
uses: xamarin/backport-bot-action/.github/workflows/[email protected]
27+
with:
28+
pull_request_url: ${{ github.event.issue.pull_request.url }}
29+
target_branch: ${{ needs.setupBackport.outputs.target_branch }}
30+
comment_author: ${{ github.actor }}
31+
github_repository: ${{ github.repository }}
32+
use_fork: false
33+
secrets:
34+
ado_organization: ${{ secrets.ADO_PROJECTCOLLECTION }}
35+
ado_project: ${{ secrets.ADO_PROJECT }}
36+
backport_pipeline_id: ${{ secrets.BACKPORT_PIPELINEID }}
37+
ado_build_pat: ${{ secrets.ADO_BUILDPAT }}
38+
github_account_pat: ${{ secrets.SERVICEACCOUNT_PAT }}

0 commit comments

Comments
 (0)