Repository navigation
Add Windows ARM64 wheels #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Changeset Reminder | ||
|
Check warning on line 1 in .github/workflows/changeset-reminder.yml
|
||
| # Comment once with a short format guide when a PR has no .changeset file, and | ||
| # delete that comment once one is added. | ||
| on: | ||
| # Needed for a write token on fork PRs. This workflow never checks out or | ||
| # runs PR code; it only reads the PR's file list through the API. | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened] | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| remind: | ||
| name: Changeset reminder | ||
| if: | | ||
| !startsWith(github.event.pull_request.head.ref, 'release/changesets-') | ||
| && !startsWith(github.event.pull_request.head.ref, 'renovate/') | ||
| && !endsWith(github.event.pull_request.user.login, '[bot]') | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
| - name: Comment when the PR has no changeset | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| marker="<!-- changeset-reminder -->" | ||
| files=$(gh api --paginate "repos/$REPO/pulls/$PR_NUMBER/files" \ | ||
| --jq '.[] | "\(.status) \(.filename)"') | ||
| # Dependency-only updates (lockfiles / package.json, and the root | ||
| # pyproject.toml, which is the unpublished workspace config) don't need | ||
| # a changeset. Package pyproject.toml files declare published runtime | ||
| # dependencies, so changing them still gets the reminder. | ||
| if [ -z "$(grep -vE '^[a-z]+ ((.*/)?([^/]+\.lock|package\.json|pnpm-lock\.yaml)|pyproject\.toml)$' <<< "$files")" ]; then | ||
| echo "Only dependency files changed, skipping" | ||
| exit 0 | ||
| fi | ||
| changesets=$(grep -v '^removed ' <<< "$files" | cut -d' ' -f2- \ | ||
| | grep -E '^\.changeset/[^/]+\.md$' | grep -viE '/readme\.md$' || true) | ||
| existing=$(gh api --paginate "repos/$REPO/issues/$PR_NUMBER/comments" \ | ||
| --jq ".[] | select(.user.login == \"github-actions[bot]\" and (.body | contains(\"$marker\"))) | .id") | ||
| if [ -n "$changesets" ]; then | ||
| echo "Changeset found:"; echo "$changesets" | ||
| # Drop the reminder once a changeset has been added | ||
| for id in $existing; do | ||
| gh api -X DELETE "repos/$REPO/issues/comments/$id" | ||
| done | ||
| exit 0 | ||
| fi | ||
| if [ -n "$existing" ]; then | ||
| echo "Reminder already posted" | ||
| exit 0 | ||
| fi | ||
| cat > "$RUNNER_TEMP/reminder.md" <<'EOF' | ||
| <!-- changeset-reminder --> | ||
| 👋 This PR has no changeset. If it should be released, add a markdown file under `.changeset/` (any name, e.g. `.changeset/fix-token-parsing.md`): | ||
| ```md | ||
| --- | ||
| "livekit-rtc": patch | ||
| --- | ||
| Short description of the change, used in the release notes. | ||
| ``` | ||
| - **Packages:** `livekit-rtc`, `livekit-api`, `livekit-protocol` (one line per package) | ||
| - **Types:** `patch`, `minor`, `major`, `patch-rc`, `minor-rc`, `major-rc`, `next-rc`, `promote` | ||
| If this change doesn't need a release (docs, CI, tests), you can ignore this comment. | ||
| EOF | ||
| gh pr comment "$PR_NUMBER" --repo "$REPO" --body-file "$RUNNER_TEMP/reminder.md" | ||