Skip to content

Commit

Permalink
feat: add pr url to source payload (odigos-io#2288)
Browse files Browse the repository at this point in the history
  • Loading branch information
AvihuHenya authored Jan 29, 2025
1 parent 2b506f0 commit 56054bc
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/trigger-odigos-enterprise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,29 @@ on:
jobs:
trigger-odigos-enterprise:
runs-on: ubuntu-latest
steps:
steps:
- name: Fetch Associated PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
REPO="${{ github.repository }}"
REPO_OWNER=$(echo $REPO | cut -d'/' -f1)
REPO_NAME=$(echo $REPO | cut -d'/' -f2)
COMMIT_SHA="${{ github.sha }}" # Commit SHA from the push event
# Query GitHub API for PRs linked to the commit
RESPONSE=$(curl -s \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.groot-preview+json" \
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/commits/$COMMIT_SHA/pulls")
# Extract PR URL
PR_URL=$(echo "$RESPONSE" | jq -r '.[0].html_url')
- name: Trigger process PR in Odigos Enterprise
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.RELEASE_BOT_TOKEN }}" \
https://api.github.com/repos/odigos-io/odigos-enterprise/dispatches \
-d '{"event_type": "process_update_dependencies_pr", "client_payload": {"pr_creator": "${{ github.event.pusher.name }}"}}'
-d '{"event_type": "process_update_dependencies_pr", "client_payload": {"pr_creator": "${{ github.event.pusher.name }}", "source_pr_url": "${{ env.PR_URL }}" }}'

0 comments on commit 56054bc

Please sign in to comment.