From 995b398165f5773be86a761e6a602ab59419c93a Mon Sep 17 00:00:00 2001 From: Laukik Hase Date: Fri, 3 Sep 2021 14:21:09 +0530 Subject: [PATCH] gh_action: Sync approved Github PRs to Gitlab - Checks for forbidden files modification (.gitlab/.github) and PR approver access level - Approver decides the approach for PR merging (Rebase or direct Merge) --- .github/workflows/pr_approved.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/pr_approved.yml diff --git a/.github/workflows/pr_approved.yml b/.github/workflows/pr_approved.yml new file mode 100644 index 0000000000..fb19ffeffe --- /dev/null +++ b/.github/workflows/pr_approved.yml @@ -0,0 +1,21 @@ +name: GitHub PR to Internal Codebase Sync +on: + pull_request_review: + types: [submitted] + +jobs: + sync_prs_to_internal_codebase: + name: GitHub PR to Internal Codebase Sync + runs-on: ubuntu-latest + if: github.event.review.state == 'approved' && (contains(github.event.review.body, '/rebase') || contains(github.event.review.body, '/merge')) + steps: + - uses: actions/checkout@master + - name: GitHub PR to Internal Codebase Sync + uses: espressif/github-actions/github_pr_to_internal_pr@master + env: + GITLAB_URL: ${{ secrets.GITLAB_URL }} + GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_CONFIG_NAME: ${{ secrets.GIT_CONFIG_NAME }} + GIT_CONFIG_EMAIL: ${{ secrets.GIT_CONFIG_EMAIL }} + JIRA_PROJECT: IDFGH