From 1563269a7463625446316307d220d352abfd94e3 Mon Sep 17 00:00:00 2001 From: Yaroslav Tarkan Date: Wed, 2 Oct 2024 19:57:42 +0300 Subject: [PATCH] Remove update PR branch workflow (#116) --- .github/workflows/update-pr-branch.yml | 49 -------------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/update-pr-branch.yml diff --git a/.github/workflows/update-pr-branch.yml b/.github/workflows/update-pr-branch.yml deleted file mode 100644 index 29b94fa..0000000 --- a/.github/workflows/update-pr-branch.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: 'Update PR Branch on PR Comment' - -on: - issue_comment: - types: [created] - -permissions: - contents: read - -jobs: - update_pr_branch: - name: Update PR Branch on PR Comment - if: github.event.issue.pull_request != '' && github.event.comment.body == '/update' - runs-on: ubuntu-latest - steps: - - name: Fetch latest code - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - with: - token: ${{ secrets.ACTIONS_PAT }} - fetch-depth: 0 - submodules: 'true' - - name: Fetch PR and target branch names - id: fetch_pr_and_target_branch - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { issue, repository } = context.payload; - const [ owner, repo ] = repository.full_name.split('/'); - const { data: pullRequest } = await github.pulls.get({ - owner, - repo, - pull_number: issue.number - }); - const { ref: prBranch } = pullRequest.head; - const { ref: baseBranch } = pullRequest.base; - const { clone_url: prRemoteUrl } = pullRequest.head.repo; - console.log(`##[set-output name=pr_branch;]${prBranch}`); - console.log(`##[set-output name=pr_remote_url;]${prRemoteUrl}`); - console.log(`##[set-output name=base_branch;]${baseBranch}`); - - name: Update PR branch - run: | - git remote add pr_remote ${{ steps.fetch_pr_and_target_branch.outputs.pr_remote_url }} - git fetch pr_remote - git checkout ${{ steps.fetch_pr_and_target_branch.outputs.pr_branch }} - git config user.name 'github-actions[bot]' - git config user.email '41898282+github-actions[bot]@users.noreply.github.com' - git merge ${{ steps.fetch_pr_and_target_branch.outputs.base_branch }} --no-edit - git push