From 819aeed1d1f47163aa3971d7867548928d39821a Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Thu, 23 Jan 2025 09:30:17 -0500 Subject: [PATCH] More testing --- .github/workflows/pull-request-checks.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml index e2352eaf6..73564c9b6 100644 --- a/.github/workflows/pull-request-checks.yml +++ b/.github/workflows/pull-request-checks.yml @@ -12,10 +12,15 @@ on: - '!.github/ISSUE_TEMPLATE/**' workflow_dispatch: null +env: + GH_TOKEN: ${{ github.token }} + jobs: check-if-branch-is-ahead-of-main: if: ${{ github.base_ref == 'main' }} runs-on: ubuntu-latest + outputs: + pr_number: ${{ steps.pr-number.outputs.pull_request_number }} steps: - name: Git checkout uses: actions/checkout@v4 @@ -27,15 +32,19 @@ jobs: if ! git merge-base --is-ancestor origin/main ${{ github.event.pull_request.head.sha }}; then echo "This branch is not up to date with main"; exit 1; fi + echo "pull_request_number=$(gh pr view --json number -q .number || echo "")" + gh pr comment $pull_request_number \ + --body "This pull request is not up to date with main. Please merge main into this brach or rebase this branch onto main. This PR should not be approved until this the status checks pass." - - name: Get Pull Request Number - id: pr-number - run: echo "pull_request_number=$(gh pr view --json number -q .number || echo "")" >> $GITHUB_OUTPUT - - name: Comment on PR that it is not up to date - run: | - gh pr comment ${{ steps.pr-number.outputs.pull_request_number }} \ - --body "This pull request is not up to date with main. Please merge main into this brach or rebase this branch onto main. This PR should not be approved until this the status checks pass." + # - name: Get Pull Request Number + # id: pr-number + # run: echo "pull_request_number=$(gh pr view --json number -q .number || echo "")" >> $GITHUB_OUTPUT + + # - name: Comment on PR that it is not up to date + # run: | + # gh pr comment ${{ steps.pr-number.outputs.pull_request_number }} \ + # --body "This pull request is not up to date with main. Please merge main into this brach or rebase this branch onto main. This PR should not be approved until this the status checks pass." check-for-changes: runs-on: ubuntu-latest