From 9762875f7b45ac21883bb83075152821de27551f Mon Sep 17 00:00:00 2001 From: Dhia Ayachi Date: Tue, 17 May 2022 11:32:40 -0400 Subject: [PATCH] add a github workflow to trigger ent->oss merge on every PR merged (#13072) * add a github workflow to trigger ent->oss merge on every PR merged * remove the workflow automation ref to trigger-oss-merge in circle-ci * remove workflow automation * revert circle-ci changes * add actor * remove cherrypicker * add condition to avoid running in enterprise --- .github/workflows/oss-merge-trigger.yml | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/oss-merge-trigger.yml diff --git a/.github/workflows/oss-merge-trigger.yml b/.github/workflows/oss-merge-trigger.yml new file mode 100644 index 000000000..a83ca1747 --- /dev/null +++ b/.github/workflows/oss-merge-trigger.yml @@ -0,0 +1,26 @@ +name: Trigger OSS to Enterprise Merge +on: + pull_request_target: + types: + - closed + branches: + - main + - 'releases/*.*.x' + +jobs: + trigger-oss-merge: + # run this only on merge events in OSS repo + if: ${{ github.event.pull_request.merged && github.repository == 'hashicorp/consul' }} + runs-on: ubuntu-latest + steps: + - name: Trigger Merge + env: + GIT_REF: ${{ github.ref_name }} + GIT_SHA: ${{ github.sha }} + GH_PAT: ${{ secrets.ELEVATED_GITHUB_TOKEN }} + GIT_ACTOR: ${{ github.actor }} + run: | + curl -H "Authorization: token $GH_PAT" \ + -H 'Accept: application/json' \ + -d "{\"event_type\": \"oss-merge\", \"client_payload\": {\"git-ref\": \"${GIT_REF}\", \"git-sha\": \"${GIT_SHA}\", \"git-actor\": \"${GIT_ACTOR}\" }}" \ + "https://api.github.com/repos/hashicorp/consul-enterprise/dispatches" \ No newline at end of file