Skip to content

Commit eb1438c

Browse files
Onboarding PR: Branch Cleaner (#1)
* Onboarding PR: Branch Cleaner * Add custom input configuration file * Onboarding PR: Branch Cleaner --------- Co-authored-by: almtools-governance[bot] <208459187+almtools-governance[bot]@users.noreply.github.com>
1 parent e572e15 commit eb1438c

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"default_recipient": "Jenkins_pega",
3+
"days_before_branch_delete": 7,
4+
"exempt_branches_regex": ""
5+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Branch Cleaner
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
token:
7+
description: 'GitHub authentication token (PAT or GitHub App token) with required permissions for API access.'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
actions: write
15+
16+
jobs:
17+
custom-input-configuration:
18+
runs-on: ${{ vars.GOVERNANCE_RUNNER }}
19+
outputs:
20+
default_recipient: ${{ steps.input_config.outputs.default_recipient}}
21+
days_before_branch_delete: ${{ steps.input_config.outputs.days_before_branch_delete}}
22+
exempt_branches_regex: ${{ steps.input_config.outputs.exempt_branches_regex}}
23+
steps:
24+
- name: Checkout repository
25+
uses: Pega-ProductEngineering/sdea-ci-standards/actions/checkout@v1
26+
27+
- name: input-configuration
28+
id: input_config
29+
run: |
30+
default_recipient=$(jq -r '.default_recipient' .github/config/branch-cleaner-config.json)
31+
days_before_branch_delete=$(jq -r '.days_before_branch_delete // empty' .github/config/branch-cleaner-config.json)
32+
exempt_branches_regex=$(jq -r '.exempt_branches_regex // empty' .github/config/branch-cleaner-config.json)
33+
echo "default_recipient=$default_recipient" >> $GITHUB_OUTPUT
34+
echo "days_before_branch_delete=$days_before_branch_delete" >> $GITHUB_OUTPUT
35+
echo "exempt_branches_regex=$exempt_branches_regex" >> $GITHUB_OUTPUT
36+
37+
branch-cleanup:
38+
needs: custom-input-configuration
39+
uses: Pega-ProductEngineering/branch-cleanup/.github/workflows/master-branch-cleanup.yml@v2.0.0
40+
with:
41+
default-recipient: ${{ needs.custom-input-configuration.outputs.default_recipient}}
42+
days-before-branch-delete: ${{ needs.custom-input-configuration.outputs.days_before_branch_delete }}
43+
exempt-branches-regex: ${{ needs.custom-input-configuration.outputs.exempt_branches_regex }}
44+
token: ${{ inputs.token }}
45+
runner: ${{ vars.GOVERNANCE_RUNNER }}

0 commit comments

Comments
 (0)