From 8e6fbb79d5ae0b672cf99e6e942d391f3a87ee5b Mon Sep 17 00:00:00 2001 From: Robert Hurst Date: Fri, 1 Nov 2024 13:33:51 +0200 Subject: [PATCH 1/3] patch-minor-bypass --- .github/workflows/patch-minor-merge.yml | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/patch-minor-merge.yml diff --git a/.github/workflows/patch-minor-merge.yml b/.github/workflows/patch-minor-merge.yml new file mode 100644 index 000000000..5e575952a --- /dev/null +++ b/.github/workflows/patch-minor-merge.yml @@ -0,0 +1,46 @@ +name: Direct Merge Patch to Minor + +on: + pull_request: + types: + - closed + branches: + - patch + +jobs: + direct-merge: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + # Use a personal access token with necessary permissions to bypass branch restrictions + token: ${{ secrets.BYPASS_TOKEN }} + + - name: Configure Git + run: | + git config user.name "GitHub Actions Bot" + git config user.email "actions@github.com" + + - name: Merge patch into minor + run: | + # Fetch all branches + git fetch origin + + # Checkout minor branch + git checkout minor + git pull origin minor + + # Merge patch into minor + if git merge origin/patch --no-edit; then + git push origin minor + echo "Successfully merged patch into minor" + else + echo "Merge conflicts detected. Manual intervention required." + exit 1 + fi \ No newline at end of file From 1eace6378f324fd2dac59883075b01599f32a342 Mon Sep 17 00:00:00 2001 From: Robert Hurst Date: Fri, 1 Nov 2024 13:43:43 +0200 Subject: [PATCH 2/3] patch-minor-bypass --- .github/workflows/patch-minor-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/patch-minor-merge.yml b/.github/workflows/patch-minor-merge.yml index 5e575952a..e70f246ca 100644 --- a/.github/workflows/patch-minor-merge.yml +++ b/.github/workflows/patch-minor-merge.yml @@ -20,7 +20,7 @@ jobs: with: fetch-depth: 0 # Use a personal access token with necessary permissions to bypass branch restrictions - token: ${{ secrets.BYPASS_TOKEN }} + token: ${{secrets.PAT_TOKEN}} - name: Configure Git run: | From 5c82f680376c5b2ef241f80c3431d0f317dac528 Mon Sep 17 00:00:00 2001 From: Robert Hurst Date: Fri, 1 Nov 2024 13:57:45 +0200 Subject: [PATCH 3/3] Update action --- .github/workflows/patch-minor-merge.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/patch-minor-merge.yml b/.github/workflows/patch-minor-merge.yml index e70f246ca..df252f216 100644 --- a/.github/workflows/patch-minor-merge.yml +++ b/.github/workflows/patch-minor-merge.yml @@ -17,10 +17,12 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + env: + PAT_TOKEN: ${{secrets.PAT_TOKEN}} with: fetch-depth: 0 # Use a personal access token with necessary permissions to bypass branch restrictions - token: ${{secrets.PAT_TOKEN}} + token: PAT_TOKEN - name: Configure Git run: |