Skip to content

Commit

Permalink
backport-trigger: Migrate to backport-action
Browse files Browse the repository at this point in the history
Remove dependency on outdated backport-bot-action
  • Loading branch information
mjbond-msft committed Jun 19, 2023
1 parent cb34bfe commit db255e9
Showing 1 changed file with 29 additions and 15 deletions.
44 changes: 29 additions & 15 deletions .github/workflows/backport-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,34 @@ on:
types: [created]

jobs:
launchBackportBuild:
setupBackport:
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/sudo backport')

if: github.event.issue.pull_request != '' && startswith(github.event.comment.body, '/sudo backport')
outputs:
target_branch: ${{ steps.parse_comment.outputs.target_branch }}
steps:
- uses: xamarin/[email protected]
with:
pull_request_url: ${{ github.event.issue.pull_request.url }}
comment_body: ${{ github.event.comment.body }}
comment_author: ${{ github.actor }}
github_repository: ${{ github.repository }}
ado_organization: ${{ secrets.ADO_PROJECTCOLLECTION }}
ado_project: ${{ secrets.ADO_PROJECT }}
backport_pipeline_id: ${{ secrets.BACKPORT_PIPELINEID }}
ado_build_pat: ${{ secrets.ADO_BUILDPAT }}
github_account_pat: ${{ secrets.SERVICEACCOUNT_PAT }}
use_fork: true
- name: Parse Comment
id: parse_comment
run: |
Write-Host "Parsing $env:COMMENT"
($botName, $backport, $backportTargetBranch) = [System.Text.RegularExpressions.Regex]::Split("$env:COMMENT", "\s+")
echo "::set-output name=target_branch::$backportTargetBranch"
shell: pwsh
env:
COMMENT: "${{ github.event.comment.body }}"

launchBackportBuild:
needs: setupBackport
uses: xamarin/backport-bot-action/.github/workflows/[email protected]
with:
pull_request_url: ${{ github.event.issue.pull_request.url }}
target_branch: ${{ needs.setupBackport.outputs.target_branch }}
comment_author: ${{ github.actor }}
github_repository: ${{ github.repository }}
use_fork: true
secrets:
ado_organization: ${{ secrets.ADO_PROJECTCOLLECTION }}
ado_project: ${{ secrets.ADO_PROJECT }}
backport_pipeline_id: ${{ secrets.BACKPORT_PIPELINEID }}
ado_build_pat: ${{ secrets.ADO_BUILDPAT }}
github_account_pat: ${{ secrets.SERVICEACCOUNT_PAT }}

0 comments on commit db255e9

Please sign in to comment.