Merge pull request #1071 from hashicorp/NET-6318 #487
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) HashiCorp, Inc. | |
--- | |
name: Upstream Assistant Trigger | |
on: | |
push: | |
branches: | |
- main | |
- 'release/**' | |
jobs: | |
trigger-oss-merge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Trigger Upstream Assistant | |
run: | | |
GITHUB_BRANCH=${GITHUB_REF#refs/heads/} | |
STATUS_CODE=$(curl --write-out '%{http_code}' --silent --output /dev/null \ | |
-XPOST https://api.github.com/repos/${{ github.repository }}-enterprise/dispatches \ | |
-H "Authorization: token ${{ secrets.ELEVATED_GITHUB_TOKEN }}" \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Content-Type: application/json" \ | |
--data '{"event_type": "trigger_oss_merge", "client_payload": {"repository": "${{ github.repository }}", "branch": "'$GITHUB_BRANCH'"}}' | |
) | |
echo "$STATUS_CODE" | |
if [ "$STATUS_CODE" != "204" ]; then | |
exit 1 | |
fi |