mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 08:09:22 +00:00
50 lines
1.8 KiB
YAML
50 lines
1.8 KiB
YAML
name: initiate_enterprise_build
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
|
|
jobs:
|
|
initiate_enterprise_build:
|
|
if: ${{ github.event.pull_request.head.repo.fork == false }} # Only run for PRs which are not from forks
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- name: Generate token
|
|
id: generate_token
|
|
uses: actions/create-github-app-token@v3
|
|
with:
|
|
private-key: ${{ secrets.PRIVATE_KEY }}
|
|
app-id: ${{ secrets.APP_ID }}
|
|
# Set the owner, so the token can be used in all repositories
|
|
owner: ${{ github.repository_owner }}
|
|
- name: Set build short sha
|
|
shell: bash
|
|
run: |
|
|
unset SHORT_COMMIT_ID
|
|
echo "SHORT_COMMIT_ID=${GITHUB_HEAD_SHA:0:7}" >> $GITHUB_ENV
|
|
echo "COMMIT_ID=${GITHUB_HEAD_SHA}" >> $GITHUB_ENV
|
|
|
|
- name: Confirm git commit SHA output
|
|
run: echo ${{ env.SHORT_COMMIT_ID }}
|
|
|
|
- name: Repository Dispatch
|
|
uses: peter-evans/repository-dispatch@v4
|
|
env:
|
|
TOKEN: ${{ steps.generate_token.outputs.token }}
|
|
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
|
with:
|
|
token: ${{ env.TOKEN }} # access token
|
|
repository: openobserve/o2-enterprise
|
|
event-type: initiate-enterprise-build
|
|
client-payload: '{"o2_enterprise_repo": "${{ env.BRANCH_NAME }}", "o2_opensource_repo": "${{ env.BRANCH_NAME }}" ,"o2_commit_id": "${{ env.SHORT_COMMIT_ID }}", "o2_full_commit":"${{env.COMMIT_ID}}", "o2_target_branch": "${{ github.event.pull_request.base.ref }}"}'
|