From cfda535a580756f4a6b3f472770aed68ce995727 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:45:36 +0100 Subject: [PATCH] Update generate-app-headers.yaml --- .github/workflows/generate-app-headers.yaml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generate-app-headers.yaml b/.github/workflows/generate-app-headers.yaml index 7ba94340..f76f2b7a 100644 --- a/.github/workflows/generate-app-headers.yaml +++ b/.github/workflows/generate-app-headers.yaml @@ -71,13 +71,16 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - PR_EXISTS=$(gh pr list --head "update-app-headers" | grep -o '[0-9]\+') + echo "Checking if PR exists." + PR_EXISTS=$(gh pr list --head "update-app-headers" --json number --jq '.[].number') + echo "PR_EXISTS: $PR_EXISTS" if [ -z "$PR_EXISTS" ]; then echo "Creating a new PR." - gh pr create --title "[core]: update .app-headers to latest version" \ - --body "This PR automatically updates the .app-headers file." \ - --head update-app-headers \ - --base main + PR_URL=$(gh pr create --title "[core]: update .app-headers to latest version" \ + --body "This PR automatically updates the .app-headers file." \ + --head update-app-headers \ + --base main -q .url) + echo "PR created: $PR_URL" else echo "PR already exists." fi @@ -88,14 +91,14 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "Attempting to merge PR." - PR_NUMBER=$(gh pr list --head "update-app-headers" | grep -o '[0-9]\+') + PR_NUMBER=$(gh pr list --head "update-app-headers" --json number --jq '.[].number') + echo "Found PR number: $PR_NUMBER" if [ -n "$PR_NUMBER" ]; then gh pr merge "$PR_NUMBER" --merge --admin --delete-branch echo "PR merged successfully." else echo "No PR found to merge." fi - # Step 9: Final status output - name: Output final status run: |