From 94b986c1856538bbce6faebf277948b88e822897 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Sun, 15 Oct 2023 20:23:11 -0400 Subject: [PATCH] Just echo vars for now --- .github/workflows/check_pr_branch.yml | 11 ++++------- .github/workflows/get_pr_target_branch.sh | 16 ---------------- 2 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 .github/workflows/get_pr_target_branch.sh diff --git a/.github/workflows/check_pr_branch.yml b/.github/workflows/check_pr_branch.yml index 11779ffa5f..1fba3af7d7 100644 --- a/.github/workflows/check_pr_branch.yml +++ b/.github/workflows/check_pr_branch.yml @@ -9,10 +9,7 @@ jobs: with: fetch-depth: 0 - - name: Get PR target branch - id: get-target-branch - run: bash .github/workflows/get_pr_target_branch.sh - - - name: No PRs should target the main branch; use development instead - if: ${{ steps.get-target-branch.outputs.target_branch == 'main' }} - run: exit 1 + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" diff --git a/.github/workflows/get_pr_target_branch.sh b/.github/workflows/get_pr_target_branch.sh deleted file mode 100644 index b0a14ef502..0000000000 --- a/.github/workflows/get_pr_target_branch.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# Get the PR number from the GitHub context -PR_NUMBER=${{ github.event.pull_request.number }} - -# Call the GitHub API to get the PR details -PR_DETAILS=$(curl \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER") - -# Extract the base ref (target branch) from the PR details -TARGET_BRANCH=$(echo "$PR_DETAILS" | jq -r '.base.ref') - -# Output the target branch -echo "::set-output name=target_branch::$TARGET_BRANCH"