From d2bb40f021202f972859de182399bfb507c021e1 Mon Sep 17 00:00:00 2001 From: Youssef1313 <31348972+Youssef1313@users.noreply.github.com> Date: Fri, 10 Jan 2025 06:46:35 +0000 Subject: [PATCH] [create-pull-request] automated change --- changes.patch | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 changes.patch diff --git a/changes.patch b/changes.patch new file mode 100644 index 0000000000..e13062c2fa --- /dev/null +++ b/changes.patch @@ -0,0 +1,53 @@ +From 997de70fd8ae54af3346b426d6fa3296c1c5c7c0 Mon Sep 17 00:00:00 2001 +From: Youssef1313 +Date: Fri, 10 Jan 2025 07:44:50 +0100 +Subject: [PATCH] backport GH Action + +--- + .github/workflows/backport-base.yml | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/.github/workflows/backport-base.yml b/.github/workflows/backport-base.yml +index 8518144320..d416f98ae2 100644 +--- a/.github/workflows/backport-base.yml ++++ b/.github/workflows/backport-base.yml +@@ -115,6 +115,8 @@ jobs: + env: + BACKPORT_PR_TITLE_TEMPLATE: ${{ inputs.pr_title_template }} + BACKPORT_PR_DESCRIPTION_TEMPLATE: ${{ inputs.pr_description_template }} ++ GITHUB_TOKEN: ${{ secrets.BACKPORT_MACHINE_USER_PAT }} ++ GH_TOKEN: ${{ secrets.BACKPORT_MACHINE_USER_PAT }} + with: + script: | + const target_branch = '${{ steps.target-branch-extractor.outputs.result }}'; +@@ -145,14 +147,6 @@ jobs: + await exec.exec(`git checkout ${target_branch}`); + await exec.exec(`git clean -xdff`); + +- // configure git +- await exec.exec(`git config user.name "github-actions"`); +- await exec.exec(`git config user.email "github-actions@github.com"`); +- +- // create temporary backport branch +- const temp_branch = `backport/pr-${pr_number}-to-${target_branch}`; +- await exec.exec(`git checkout -b ${temp_branch}`); +- + // skip opening PR if the branch already exists on the origin remote since that means it was opened + // by an earlier backport and force pushing to the branch updates the existing PR + let should_open_pull_request = true; +@@ -164,6 +158,15 @@ jobs: + // download and apply patch + await exec.exec(`curl -sSL "${context.payload.issue.pull_request.patch_url}" --output changes.patch`); + ++ ++ // create temporary backport branch ++ // const temp_branch = `backport/pr-${pr_number}-to-${target_branch}`; ++ // await exec.exec(`git checkout -b ${temp_branch}`); ++ ++ // configure git ++ // await exec.exec(`git config user.name "github-actions"`); ++ // await exec.exec(`git config user.email "github-actions@github.com"`); ++ + // const git_am_command = "git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch"; + // let git_am_output = `$ ${git_am_command}\n\n`; + // let git_am_failed = false;