Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/backport-label-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Backport Label Audit

on:
workflow_dispatch:
inputs:
version:
description: 'Release version to audit (e.g., 1.13). Leave empty to audit all versions.'
required: false
type: string
dry_run:
description: 'Dry run (only report, do not modify)'
required: true
type: choice
options:
- 'true'
- 'false'
default: 'true'

jobs:
audit-backport-labels:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout Backporter
uses: actions/checkout@v4
with:
repository: KristofferC/Backporter
ref: master
path: backporter

- name: Setup Julia
uses: julia-actions/setup-julia@v2
with:
version: '1'

- name: Install dependencies
run: |
cd backporter
julia --project -e 'using Pkg; Pkg.instantiate()'

- name: Run backport label audit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd backporter
ARGS="--audit -r ${{ github.repository }}"
if [ -n "${{ inputs.version }}" ]; then
ARGS="$ARGS -v ${{ inputs.version }}"
fi
if [ "${{ inputs.dry_run }}" = "false" ]; then
ARGS="$ARGS --apply"
fi
julia --project backporter.jl $ARGS
56 changes: 56 additions & 0 deletions .github/workflows/backport-label-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Backport Label Cleanup

on:
pull_request:
types: [closed]
branches:
- 'release-*'

jobs:
remove-backport-labels:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Extract version from branch
id: extract
run: |
BRANCH="${{ github.event.pull_request.base.ref }}"
if [[ "$BRANCH" =~ ^release-([0-9]+\.[0-9]+)$ ]]; then
echo "version=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
else
echo "Branch $BRANCH does not match release-X.Y pattern"
exit 0
fi

- name: Checkout Backporter
if: steps.extract.outputs.version != ''
uses: actions/checkout@v4
with:
repository: KristofferC/Backporter
ref: master
path: backporter

- name: Setup Julia
if: steps.extract.outputs.version != ''
uses: julia-actions/setup-julia@v2
with:
version: '1'

- name: Install dependencies
if: steps.extract.outputs.version != ''
run: |
cd backporter
julia --project -e 'using Pkg; Pkg.instantiate()'

- name: Run backport label cleanup
if: steps.extract.outputs.version != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd backporter
julia --project backporter.jl --audit \
-v ${{ steps.extract.outputs.version }} \
-r ${{ github.repository }} \
--cleanup-pr ${{ github.event.pull_request.number }}
Loading