Skip to content

Commit

Permalink
Update pull-request-checks.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
joeparsons authored Jun 24, 2024
1 parent af4ee93 commit 3790fd7
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,20 @@ jobs:
- name: Check for branch in Quickstart repo
id: check-quickstart-branch
run: |
EXISTS=$(gh api repos/az-digital/az_quickstart/branches/${{ github.head_ref }} -q '.name' || echo '')
if [[ -z $EXISTS ]]; then
echo "QUICKSTART_BRANCH_NAME=main" >> $GITHUB_ENV
if [ $(git ls-remote --heads https://github.com/az-digital/az_quickstart.git ${{ github.head_ref }} | wc -l) = 1 ]; then
echo "QUICKSTART_BRANCH_NAME=${{ github.head_ref }}" >> ${GITHUB_ENV}
else
echo "QUICKSTART_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
echo "QUICKSTART_BRANCH_NAME=main" >> ${GITHUB_ENV}
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check for branch in scaffolding repo
id: check-scaffolding-branch
run: |
EXISTS=$(gh api repos/az-digital/az-quickstart-scaffolding/branches/${{ github.head_ref }} -q '.name' || echo '')
if [[ -z $EXISTS ]]; then
echo "SCAFFOLDING_BRANCH_NAME=main" >> $GITHUB_ENV
if [ $(git ls-remote --heads https://github.com/az-digital/az-quickstart-scaffolding.git ${{ github.head_ref }} | wc -l) = 1 ]; then
echo "SCAFFOLDING_BRANCH_NAME=${{ github.head_ref }}" >> ${GITHUB_ENV}
else
echo "SCAFFOLDING_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
echo "SCAFFOLDING_BRANCH_NAME=main" >> ${GITHUB_ENV}
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout scaffolding repo
uses: actions/checkout@v4
Expand Down

0 comments on commit 3790fd7

Please sign in to comment.