Skip to content

Commit

Permalink
More testing
Browse files Browse the repository at this point in the history
  • Loading branch information
asteel-gsa committed Jan 23, 2025
1 parent ec2f5f7 commit 819aeed
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 819aeed

Please sign in to comment.