Skip to content

Commit

Permalink
fix: release bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nis Jespersen committed Dec 11, 2024
1 parent 2378457 commit 87cb8ad
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/schema-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,20 @@ jobs:
BRANCH_NAME="release-${{ github.event.client_payload.release.index }}-${{ github.run_id }}"
echo "Creating and switching to new branch $BRANCH_NAME"
git checkout -b $BRANCH_NAME
- name: Prepare working directory
run: mkdir -p docs/schemas

- name: Download and copy JSON schemas
run: |
echo "Download JSON schemas from release payload..."
JSON_SCHEMAS=$(echo '${{ toJson(github.event.client_payload.artefacts.jsonSchemas) }}' | jq -c '.')
for schema in $(echo $JSON_SCHEMAS | jq -c '.[]'); do
FILE_NAME=$(echo $schema | jq -r '.fileName')
URL=$(echo $schema | jq -r '.url')
echo "Downloading $FILE_NAME from $URL..."
curl -L $URL -o "docs/schemas/$FILE_NAME"
done
- name: Download and data model diagram
run: |
# Download data model
echo "Download data model diagram from release payload..."
DATA_MODEL=$(echo '${{ toJson(github.event.client_payload.artefacts.dataModel) }}' | jq -c '.')
DATA_MODEL_FILE_NAME=$(echo $DATA_MODEL | jq -r '.fileName')
DATA_MODEL_URL=$(echo $DATA_MODEL | jq -r '.url')
echo "Downloading data model $DATA_MODEL_FILE_NAME from $DATA_MODEL_URL..."
curl -L $DATA_MODEL_URL -o "docs/schemas/$DATA_MODEL_FILE_NAME"
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
Expand All @@ -53,20 +40,18 @@ jobs:
echo "Adding and committing downloaded files..."
git add docs/schemas
git commit -m "Add JSON schema files from release repository_dispatch event"
- name: Push branch
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH_NAME="release-${{ github.event.client_payload.release.index }}-${{ github.run_id }}"
echo "Pushing branch $BRANCH_NAME"
git push https://x-access-token:${TOKEN}@github.com/${{ github.repository }} $BRANCH_NAME
- name: Create pull request
run: |
PR_TITLE="${{ github.event.client_payload.domain.name }} ${{ github.event.client_payload.action.type }}"
echo "Creating pull request with title: $PR_TITLE"
gh pr create -B main -H release-${{ github.event.client_payload.snapshot.index }}-${{ github.run_id }} --title "$PR_TITLE" --body 'PR generated from Jargon.'
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

0 comments on commit 87cb8ad

Please sign in to comment.