Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/update-schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
pull-requests: write

jobs:

update-schemas: #----------------------------------------------------------
Expand All @@ -33,7 +37,7 @@ jobs:

- name: Commit and Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ github.token }}
PR_BODY: |
Comment thread
swissspidy marked this conversation as resolved.
**This is an automated pull-request**

Expand All @@ -47,10 +51,9 @@ jobs:
git checkout -b update-schemas
git add assets/
git commit -m "Update schema fallback files"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
git push -f origin update-schemas

PR_NUMBER=$(gh pr list --head update-schemas --json number --jq '.[0].number')
PR_NUMBER=$(gh pr list --head update-schemas --json number --jq '.[0].number // empty')
if [ -z "$PR_NUMBER" ]; then
gh pr create \
--title "Update schema fallback files" \
Expand All @@ -59,6 +62,13 @@ jobs:
--base "${{ github.event.repository.default_branch }}" \
--head "update-schemas" \
--reviewer "swissspidy"
else
gh pr edit "$PR_NUMBER" \
--title "Update schema fallback files" \
--body "$PR_BODY" \
--add-label "scope:distribution" \
--base "${{ github.event.repository.default_branch }}"
fi

fi