Skip to content

Commit c9e07cc

Browse files
committed
Workflows updates to manually merge changeset PRs and control those changes
1 parent fa23dc0 commit c9e07cc

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

.changeset/changelog-config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@ const getReleaseLine = async (changeset) => {
33
.split('\n')
44
.map(l => l.trim())
55
.filter(Boolean);
6-
return `- ${firstLine}`;
6+
return `- ${firstLine}`;
77
};
88

99
const getDependencyReleaseLine = async () => {
1010
return '';
1111
};
1212

13+
const getReleaseSummary = async (release) => {
14+
return `## [${release.newVersion}]\n\n`;
15+
};
16+
1317
const changelogFunctions = {
1418
getReleaseLine,
1519
getDependencyReleaseLine,
20+
getReleaseSummary,
1621
};
1722

1823
module.exports = changelogFunctions;

.github/workflows/changeset-release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Changeset Release
2-
run-name: Changeset Release ${{ github.actor != 'R00-B0T' && '- Create PR' || '- Approve & Merge' }}
2+
run-name: Changeset Release ${{ github.actor != 'R00-B0T' && '- Create PR' || '- Ready for Review' }}
33

44
on:
55
pull_request:
@@ -84,6 +84,7 @@ jobs:
8484

8585
# Auto-merge PR
8686
- name: Automerge on PR
87-
run: gh pr merge --merge ${{ github.event.pull_request.number }}
87+
if: false # Needs enablePullRequestAutoMerge in repo settings to work
88+
run: gh pr merge --auto --merge ${{ github.event.pull_request.number }}
8889
env:
8990
GH_TOKEN: ${{ secrets.CROSS_REPO_ACCESS_TOKEN }}

.github/workflows/marketplace-publish.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
name: Publish Extension
22
on:
3-
push:
4-
branches: ["main"]
3+
pull_request:
4+
types: [closed]
55
workflow_dispatch:
66

7+
env:
8+
GIT_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'main' }}
9+
710
jobs:
811
publish-extension:
912
runs-on: ubuntu-latest
10-
if: ${{ github.actor == 'R00-B0T' || github.event_name == 'workflow_dispatch' }}
13+
if: >
14+
( github.event_name == 'pull_request' &&
15+
github.event.pull_request.base.ref == 'main' &&
16+
contains(github.event.pull_request.title, 'Changeset version bump') ) ||
17+
github.event_name == 'workflow_dispatch'
1118
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-node@v3
19+
- uses: actions/checkout@v4
20+
with:
21+
ref: ${{ env.GIT_REF }}
22+
23+
- uses: actions/setup-node@v4
1424
with:
1525
node-version: 18
1626
- run: |

0 commit comments

Comments
 (0)