diff --git a/.github/workflows/trigger-merge-to-downstream.yml b/.github/workflows/trigger-merge-to-downstream.yml deleted file mode 100644 index 19657a9c8e..0000000000 --- a/.github/workflows/trigger-merge-to-downstream.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: trigger-merge-to-downstream - -on: - push: - branches: - - main - - release/** - -permissions: - contents: read - -jobs: - trigger-merge: - if: github.repository == 'hashicorp/boundary' - runs-on: ${{ fromJSON(vars.RUNNER) }} - env: - DOWNSTREAM_SLUG: ${{ vars.DOWNSTREAM_SLUG }} - DOWNSTREAM_TOK: ${{ secrets.DOWNSTREAM_TOK }} - DOWNSTREAM_WORKFLOW: ${{ vars.DOWNSTREAM_WORKFLOW }} - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Trigger Merge - run: | - ./scripts/trigger-merge-to-downstream-gha ${{ github.ref_name }} diff --git a/scripts/trigger-merge-to-downstream-gha b/scripts/trigger-merge-to-downstream-gha deleted file mode 100755 index 0259af1d7e..0000000000 --- a/scripts/trigger-merge-to-downstream-gha +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash - -BRANCH=${1} - -if [[ -z "${BRANCH}" ]]; then - echo "skipping no branch specified" - exit 0 -fi - -if [[ -z "${DOWNSTREAM_SLUG}" ]]; then - echo "skipping, no downstream" - exit 0 -fi - -if [[ -z ${DOWNSTREAM_TOK} ]]; then - exit 0 -fi - -if [[ -z ${DOWNSTREAM_WORKFLOW} ]]; then - echo "skipping, no downstream workflow" - exit 0 -fi - -CURL_RESPONSE=$(curl \ - --silent \ - -w '%{http_code}\n' \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${DOWNSTREAM_TOK}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/repos/hashicorp/boundary-${DOWNSTREAM_SLUG}/actions/workflows/${DOWNSTREAM_WORKFLOW}/dispatches" \ - -d @- << EOF -{ - "ref": "${BRANCH}", - "inputs": { - "from-branch": "${BRANCH}", - "to-branch": "${BRANCH}" - } -} -EOF -) -echo $CURL_RESPONSE - -# Get the first digit of the status code (get the last word of the last line, -# and then get the first character of that word) -CURL_STATUS_CODE=$(echo "$CURL_RESPONSE" | tail -n1 | awk '{print $NF}' | cut -c1) - -if [[ $CURL_STATUS_CODE -ne 2 ]]; then - echo "ERROR: failed to trigger downstream workflow" - exit 1 -fi