diff --git a/.github/workflows/build_packages.yaml b/.github/workflows/build_packages.yaml index 057435e4e..2562a725f 100644 --- a/.github/workflows/build_packages.yaml +++ b/.github/workflows/build_packages.yaml @@ -356,7 +356,7 @@ jobs: if: github.event_name == 'release' run: | curl --silent --show-error \ - -H "Authorization: token ${{ secrets.AccessToken }}" \ + -H "Authorization: token ${{ secrets.CI_GIT_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ -X POST \ -d "{\"ref\":\"v1.0.1\",\"inputs\":{\"version\": \"${{ env.version }}\", \"emqx_ce\": \"true\"}}" \ @@ -366,7 +366,7 @@ jobs: run: | if [ -z $(echo $version | grep -oE "(alpha|beta|rc)\.[0-9]") ]; then curl --silent --show-error \ - -H "Authorization: token ${{ secrets.AccessToken }}" \ + -H "Authorization: token ${{ secrets.CI_GIT_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ -X POST \ -d "{\"ref\":\"v1.0.1\",\"inputs\":{\"version\": \"${{ env.version }}\"}}" \ diff --git a/.github/workflows/git_sync.yaml b/.github/workflows/git_sync.yaml new file mode 100644 index 000000000..a57a68ceb --- /dev/null +++ b/.github/workflows/git_sync.yaml @@ -0,0 +1,29 @@ +name: Sync to enterprise + +on: + push: + branches: + - master + +jobs: + sync_to_enterprise: + runs-on: ubuntu-20.04 + if: github.repository == 'emqx/emqx' + steps: + - name: git-sync + uses: Rory-Z/git-sync@v3.0.1 + with: + source_repo: ${{ github.repository }} + source_branch: ${{ github.ref }} + destination_repo: "${{ github.repository_owner }}/emqx-enterprise" + destination_branch: ${{ github.ref }} + destination_ssh_private_key: "${{ secrets.CI_SSH_PRIVATE_KEY }}" + - name: create pull request + run: | + set -euo pipefail + curl --silent --show-error \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Authorization: token ${{ secrets.CI_GIT_TOEKN }}" \ + -X POST \ + -d '{"title": "Sync code into enterprise from opensource", "head": "master", "base":"enterprise"}' \ + https://api.github.com/repos/${{ github.repository_owner }}/emqx-enterprise/pulls