diff --git a/.github/workflows/QCD_workflow.yml b/.github/workflows/QCD_workflow.yml index a29d8866..bebe5b19 100644 --- a/.github/workflows/QCD_workflow.yml +++ b/.github/workflows/QCD_workflow.yml @@ -11,7 +11,7 @@ on: - 'src/BTVNanoCommissioning/utils/*' - '.github/workflows/QCD_workflow.yml' - pull_request: + pull_request_target: branches: [ master ] paths: - 'src/BTVNanoCommissioning/workflows/*QCD*' @@ -38,6 +38,13 @@ jobs: steps: - uses: actions/checkout@v2 + + - name: Merge PR locally + if: github.event_name == 'pull_request_target' + run: | + git fetch origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} + git checkout ${{ github.event.pull_request.base.ref }} + git merge --no-ff ${{ github.event.pull_request.head.sha }} - uses: cvmfs-contrib/github-action-cvmfs@v4 with: diff --git a/.github/workflows/ctag_DY_workflow.yml b/.github/workflows/ctag_DY_workflow.yml index 9297eaa8..a99ee5a5 100644 --- a/.github/workflows/ctag_DY_workflow.yml +++ b/.github/workflows/ctag_DY_workflow.yml @@ -10,7 +10,7 @@ on: - 'src/BTVNanoCommissioning/helpers/definitions.py' - 'src/BTVNanoCommissioning/utils/*' - '.github/workflows/ctag_DY_workflow.yml' - pull_request: + pull_request_target: branches: [ master ] paths: - 'src/BTVNanoCommissioning/workflows/ctag_*DY*' @@ -36,6 +36,13 @@ jobs: steps: - uses: actions/checkout@v2 + + - name: Merge PR locally + if: github.event_name == 'pull_request_target' + run: | + git fetch origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} + git checkout ${{ github.event.pull_request.base.ref }} + git merge --no-ff ${{ github.event.pull_request.head.sha }} - uses: cvmfs-contrib/github-action-cvmfs@v4 with: diff --git a/.github/workflows/ctag_Wc_workflow.yml b/.github/workflows/ctag_Wc_workflow.yml index 3e672084..e1897381 100644 --- a/.github/workflows/ctag_Wc_workflow.yml +++ b/.github/workflows/ctag_Wc_workflow.yml @@ -11,7 +11,7 @@ on: - 'src/BTVNanoCommissioning/utils/*' - '.github/workflows/ctag_Wc_workflow.yml' - pull_request: + pull_request_target: branches: [ master ] paths: - 'src/BTVNanoCommissioning/workflows/ctag_*Wc*' @@ -38,6 +38,13 @@ jobs: steps: - uses: actions/checkout@v2 + + - name: Merge PR locally + if: github.event_name == 'pull_request_target' + run: | + git fetch origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} + git checkout ${{ github.event.pull_request.base.ref }} + git merge --no-ff ${{ github.event.pull_request.head.sha }} - uses: cvmfs-contrib/github-action-cvmfs@v4 with: diff --git a/.github/workflows/ctag_ttbar_workflow.yml b/.github/workflows/ctag_ttbar_workflow.yml index 816bf2eb..eada9f37 100644 --- a/.github/workflows/ctag_ttbar_workflow.yml +++ b/.github/workflows/ctag_ttbar_workflow.yml @@ -10,7 +10,7 @@ on: - 'src/BTVNanoCommissioning/helpers/definitions.py' - 'src/BTVNanoCommissioning/utils/*' - '.github/workflows/ctag_ttbar_workflow.yml' - pull_request: + pull_request_target: branches: [ master ] paths: - 'src/BTVNanoCommissioning/workflows/ctag*tt*' @@ -37,6 +37,13 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Merge PR locally + if: github.event_name == 'pull_request_target' + run: | + git fetch origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} + git checkout ${{ github.event.pull_request.base.ref }} + git merge --no-ff ${{ github.event.pull_request.head.sha }} + - uses: cvmfs-contrib/github-action-cvmfs@v4 with: cvmfs_repositories: 'grid.cern.ch' diff --git a/.github/workflows/ttbar_workflow.yml b/.github/workflows/ttbar_workflow.yml index 1e1d5e2e..3df5f01e 100644 --- a/.github/workflows/ttbar_workflow.yml +++ b/.github/workflows/ttbar_workflow.yml @@ -10,7 +10,7 @@ on: - 'src/BTVNanoCommissioning/helpers/definitions.py' - 'src/BTVNanoCommissioning/utils/*' - '.github/workflows/ttbar_workflow.yml' - pull_request: + pull_request_target: branches: [ master ] paths: - 'src/BTVNanoCommissioning/workflows/tt*' @@ -36,6 +36,13 @@ jobs: steps: - uses: actions/checkout@v2 + + - name: Merge PR locally + if: github.event_name == 'pull_request_target' + run: | + git fetch origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} + git checkout ${{ github.event.pull_request.base.ref }} + git merge --no-ff ${{ github.event.pull_request.head.sha }} - uses: cvmfs-contrib/github-action-cvmfs@v4 with: diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index dec3ad7d..a2dc19e4 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -10,7 +10,7 @@ on: - 'src/BTVNanoCommissioning/helpers/definitions.py' - 'src/BTVNanoCommissioning/utils/*' - '.github/workflows/validation.yml' - pull_request: + pull_request_target: branches: [ master ] paths: - 'src/BTVNanoCommissioning/workflows/validation.py' @@ -36,6 +36,13 @@ jobs: steps: - uses: actions/checkout@v2 + + - name: Merge PR locally + if: github.event_name == 'pull_request_target' + run: | + git fetch origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} + git checkout ${{ github.event.pull_request.base.ref }} + git merge --no-ff ${{ github.event.pull_request.head.sha }} - uses: cvmfs-contrib/github-action-cvmfs@v4 with: