Skip to content

Commit

Permalink
implement logic, test failing scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
nedsalk committed Apr 25, 2024
1 parent 4ff1dda commit c233f13
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-olives-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"demo-wallet-sdk-react": patch
---

chore: ensure changeset PR deletes all changesets
17 changes: 17 additions & 0 deletions .github/workflows/pr-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
# e.g. when a script is added in the scripts folder
exit 0
fi
echo "CHANGESET_FILE=$(echo "$CHANGESET_FILE")" >> $GITHUB_ENV
AFFECTED_PACKAGES=$(sed -n '/---/,/---/p' "$CHANGESET_FILE" | sed '/---/d')
Expand All @@ -103,6 +104,22 @@ jobs:
env:
PR_TITLE: ${{ github.event.pull_request.title }}

- name: Validate added changeset will be deleted
if: ${{ env.CHANGESET_FILE != '' }}
run: |
pnpm changeset version
if git status --porcelain .changeset | grep -q "D $CHANGESET_FILE"; then
git reset --hard
exit 0
fi
# Throw if changeset not in deleted changesets
echo "Changeset file $CHANGESET_FILE will not get deleted in the changesets PR. Check its affected packages."
exit 1
env:
CHANGESET_FILE: ${{ env.CHANGESET_FILE }}

- name: Validate that there are only patch changes
if: startsWith(github.base_ref, 'release/')
run: |
Expand Down

0 comments on commit c233f13

Please sign in to comment.