From 8714dac097df095c4b96a4bab8a7cebf683bd398 Mon Sep 17 00:00:00 2001 From: KlaasWhite Date: Sun, 8 Nov 2026 20:38:26 +0100 Subject: [PATCH] Remove redirect workflow --- .github/workflows/redirect-external-pr.yml | 57 ---------------------- 1 file changed, 57 deletions(-) delete mode 100644 .github/workflows/redirect-external-pr.yml diff --git a/.github/workflows/redirect-external-pr.yml b/.github/workflows/redirect-external-pr.yml deleted file mode 100644 index 17cf136..0000000 --- a/.github/workflows/redirect-external-pr.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Redirect external PRs - -on: - pull_request_target: - types: [opened, reopened] - branches: [main] - -permissions: - contents: write - pull-requests: write - -jobs: - redirect: - # Only run for PRs coming from forks - if: github.event.pull_request.head.repo.full_name != github.repository - runs-on: ubuntu-latest - - steps: - - name: Resolve main branch SHA - id: mainsha - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - MAIN_SHA=$(gh api repos/${{ github.repository }}/git/ref/heads/main --jq '.object.sha') - echo "sha=$MAIN_SHA" >> $GITHUB_OUTPUT - - - name: Create internal feature branch from main - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - PR_NUMBER="${{ github.event.pull_request.number }}" - SOURCE_BRANCH="${{ github.event.pull_request.head.ref }}" - - SAFE_SOURCE_BRANCH=$(echo "$SOURCE_BRANCH" | tr '/' '-') - NEW_BRANCH="feature/external/pr-${PR_NUMBER}-${SAFE_SOURCE_BRANCH}" - - echo "Creating branch $NEW_BRANCH from main" - - gh api repos/${{ github.repository }}/git/refs \ - -f ref="refs/heads/$NEW_BRANCH" \ - -f sha="${{ steps.mainsha.outputs.sha }}" - - - name: Retarget PR to new branch - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - PR_NUMBER="${{ github.event.pull_request.number }}" - SOURCE_BRANCH="${{ github.event.pull_request.head.ref }}" - - SAFE_SOURCE_BRANCH=$(echo "$SOURCE_BRANCH" | tr '/' '-') - NEW_BRANCH="feature/external/pr-${PR_NUMBER}-${SAFE_SOURCE_BRANCH}" - - echo "Updating PR #$PR_NUMBER base to $NEW_BRANCH" - - gh api repos/${{ github.repository }}/pulls/$PR_NUMBER \ - -X PATCH \ - -f base="$NEW_BRANCH"