From 3b6774e1fffa842b8bdc1c049156faa411cbe039 Mon Sep 17 00:00:00 2001 From: arpit-bruno Date: Mon, 27 Jul 2026 16:28:57 +0530 Subject: [PATCH 1/2] Add GitHub Actions workflow for changeset management --- .github/workflows/changeset.yml | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/changeset.yml diff --git a/.github/workflows/changeset.yml b/.github/workflows/changeset.yml new file mode 100644 index 00000000..d10e31f5 --- /dev/null +++ b/.github/workflows/changeset.yml @@ -0,0 +1,52 @@ +name: Changeset + +on: + pull_request: + types: [labeled] + +jobs: + changeset: + if: startsWith(github.event.label.name, 'changeset:') + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - name: Write the changeset + env: + LABEL: ${{ github.event.label.name }} + TITLE: ${{ github.event.pull_request.title }} + BRANCH: ${{ github.event.pull_request.head.ref }} + NUMBER: ${{ github.event.pull_request.number }} + run: | + bump="${LABEL#changeset:}" + slug=$(printf '%s' "$BRANCH" \ + | tr '[:upper:]' '[:lower:]' \ + | sed -e 's#[^a-z0-9]#-#g' -e 's#--*#-#g' -e 's#^-##' -e 's#-$##') + + mkdir -p .changeset + printf -- '---\n"@opencollection/docs": %s\n---\n\n%s (#%s)\n' \ + "$bump" "$TITLE" "$NUMBER" > ".changeset/${slug}.md" + + cat ".changeset/${slug}.md" + + - name: Commit it to the PR branch + env: + ACTOR: ${{ github.actor }} + ACTOR_ID: ${{ github.actor_id }} + run: | + git config user.name "$ACTOR" + git config user.email "${ACTOR_ID}+${ACTOR}@users.noreply.github.com" + git add .changeset + if git diff --cached --quiet; then + echo "changeset unchanged, nothing to commit" + exit 0 + fi + git commit -m "chore: add changeset" + git push + From 382e15bb4bd86fa06e81c477d425f106b984f877 Mon Sep 17 00:00:00 2001 From: arpit-bruno <298621146+arpit-bruno@users.noreply.github.com> Date: Mon, 27 Jul 2026 11:03:41 +0000 Subject: [PATCH 2/2] chore: add changeset --- .changeset/arpit-bruno-patch-1-test.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/arpit-bruno-patch-1-test.md diff --git a/.changeset/arpit-bruno-patch-1-test.md b/.changeset/arpit-bruno-patch-1-test.md new file mode 100644 index 00000000..a7f06dc9 --- /dev/null +++ b/.changeset/arpit-bruno-patch-1-test.md @@ -0,0 +1,5 @@ +--- +"@opencollection/docs": minor +--- + +test: changeset label action (#1)