Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 9b00eae

Browse files
authored
Enable backports for the repo itself
1 parent 5bfd006 commit 9b00eae

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Backport trigger file adapated from https://github.com/xamarin/.github/blob/main/workflow-templates/backport-trigger/backport-trigger.yml
2+
# This trigger file is used as the basis for testing backports within the backport-bot-action repo itself
3+
name: Backport Trigger
4+
5+
on:
6+
issue_comment:
7+
types: [created]
8+
9+
jobs:
10+
setupBackport:
11+
runs-on: ubuntu-latest
12+
if: github.event.issue.pull_request != '' && startswith(github.event.comment.body, '@gitbot backport')
13+
outputs:
14+
target_branch: ${{ steps.parse_comment.outputs.target_branch }}
15+
steps:
16+
- name: Parse Comment
17+
id: parse_comment
18+
run: |
19+
Write-Host "Parsing $env:COMMENT"
20+
($botName, $backport, $backportTargetBranch) = [System.Text.RegularExpressions.Regex]::Split("$env:COMMENT", "\s+")
21+
echo "::set-output name=target_branch::$backportTargetBranch"
22+
shell: pwsh
23+
env:
24+
COMMENT: "${{ github.event.comment.body }}"
25+
26+
launchBackportBuild:
27+
needs: setupBackport
28+
uses: xamarin/backport-bot-action/.github/workflows/backport-action.yml@v1.0-test
29+
with:
30+
pull_request_url: ${{ github.event.issue.pull_request.url }}
31+
target_branch: ${{ needs.setupBackport.outputs.target_branch }}
32+
comment_author: ${{ github.actor }}
33+
github_repository: ${{ github.repository }}
34+
use_fork: false
35+
secrets:
36+
ado_organization: ${{ secrets.ADO_PROJECTCOLLECTION }}
37+
ado_project: ${{ secrets.ADO_PROJECT }}
38+
backport_pipeline_id: ${{ secrets.BACKPORT_PIPELINEID }}
39+
ado_build_pat: ${{ secrets.ADO_BUILDPAT }}
40+
github_account_pat: ${{ secrets.SERVICEACCOUNT_PAT }}

0 commit comments

Comments
 (0)