Update generate-app-headers.yaml

This commit is contained in:
CanbiZ 2025-01-10 13:11:55 +01:00 committed by GitHub
parent f7d9fe7c3a
commit 0c44d2d23c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,13 +52,13 @@ jobs:
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
PR_EXISTS=$(gh pr list --head "update-app-headers" --json number --jq '.[].number') PR_EXISTS=$(gh pr list --head "update-app-headers" | grep -o '[0-9]\+')
if [ -z "$PR_EXISTS" ]; then if [ -z "$PR_EXISTS" ]; then
echo "Creating a new PR." echo "Creating a new PR."
PR_URL=$(gh pr create --title "[core]: update .app-headers to latest version" \ PR_URL=$(gh pr create --title "[core]: update .app-headers to latest version" \
--body "This PR automatically updates the .app-headers file." \ --body "This PR automatically updates the .app-headers file." \
--head update-app-headers \ --head update-app-headers \
--base main --json url -q .url) --base main -q .url)
echo "PR created: $PR_URL" echo "PR created: $PR_URL"
else else
echo "PR already exists." echo "PR already exists."
@ -70,7 +70,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
echo "Attempting to merge PR." echo "Attempting to merge PR."
PR_NUMBER=$(gh pr list --head "update-app-headers" --json number --jq '.[].number') PR_NUMBER=$(gh pr list --head "update-app-headers" | grep -o '[0-9]\+')
if [ -n "$PR_NUMBER" ]; then if [ -n "$PR_NUMBER" ]; then
gh pr merge "$PR_NUMBER" --merge --admin --delete-branch gh pr merge "$PR_NUMBER" --merge --admin --delete-branch
echo "PR merged successfully." echo "PR merged successfully."