Skip to content

Commit 476e564

Browse files
authored
Merge pull request #133 from RooVetGit/chores/remove-ai-releases
Remove AI releases
2 parents c842d3b + 5359f82 commit 476e564

File tree

8 files changed

+123
-226
lines changed

8 files changed

+123
-226
lines changed

.changeset/changelog-config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { ChangelogFunctions } from '@changesets/types';
2+
3+
const getReleaseLine: ChangelogFunctions['getReleaseLine'] = async (changeset) => {
4+
const [firstLine] = changeset.summary
5+
.split('\n')
6+
.map(l => l.trim())
7+
.filter(Boolean);
8+
return `- ${firstLine}`;
9+
};
10+
11+
const getDependencyReleaseLine: ChangelogFunctions['getDependencyReleaseLine'] = async () => {
12+
return '';
13+
};
14+
15+
const changelogFunctions: ChangelogFunctions = {
16+
getReleaseLine,
17+
getDependencyReleaseLine,
18+
};
19+
20+
export default changelogFunctions;

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3-
"changelog": "@changesets/cli/changelog",
3+
"changelog": "./changelog-config.ts",
44
"commit": false,
55
"fixed": [],
66
"linked": [],

.github/actions/ai-release-notes/action.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@ inputs:
2020
default: ''
2121
type: string
2222
git_ref:
23-
required: false
23+
required: true
2424
type: string
25-
default: ''
2625
head_ref:
27-
required: false
26+
required: true
2827
type: string
29-
default: main
3028
base_ref:
31-
required: false
29+
required: true
3230
type: string
33-
default: main
3431

3532
outputs:
3633
RELEASE_NOTES:
@@ -41,9 +38,9 @@ outputs:
4138
value: ${{ steps.ai_prompt.outputs.OPENAI_PROMPT }}
4239

4340
env:
44-
GITHUB_REF: ${{ inputs.git_ref == '' && github.event.pull_request.head.ref || inputs.git_ref }}
45-
BASE_REF: ${{ inputs.base_ref == '' && github.base_ref || inputs.base_ref }}
46-
HEAD_REF: ${{ inputs.head_ref == '' && github.event.pull_request.head.sha || inputs.head_ref }}
41+
GITHUB_REF: ${{ inputs.git_ref }}
42+
BASE_REF: ${{ inputs.base_ref }}
43+
HEAD_REF: ${{ inputs.head_ref }}
4744

4845
runs:
4946
using: "composite"

.github/workflows/changeset-ai-releases.yml

Lines changed: 0 additions & 216 deletions
This file was deleted.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Changeset Release
2+
run-name: Changeset Release ${{ github.actor != 'R00-B0T' && '- Create PR' || '- Approve & Merge' }}
3+
4+
on:
5+
pull_request:
6+
types: [closed, opened, synchronize, labeled]
7+
8+
env:
9+
REPO_PATH: ${{ github.repository }}
10+
GIT_REF: ${{ github.event.pull_request.head.sha }}
11+
12+
jobs:
13+
# Job 1: Create version bump PR when changesets are merged to main
14+
changeset-pr-version-bump:
15+
if: >
16+
github.event_name == 'pull_request' &&
17+
github.event.pull_request.merged == true &&
18+
github.event.pull_request.base.ref == 'main' &&
19+
github.actor != 'R00-B0T'
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
steps:
25+
- name: Git Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
ref: ${{ env.GIT_REF }}
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 20
35+
cache: 'npm'
36+
37+
- name: Install Dependencies
38+
run: npm install
39+
40+
# Check if there are any new changesets to process
41+
- name: Check for changesets
42+
id: check-changesets
43+
run: |
44+
NEW_CHANGESETS=$(find .changeset -name "*.md" ! -name "README.md" | wc -l | tr -d ' ')
45+
echo "Changesets diff with previous version: $NEW_CHANGESETS"
46+
echo "new_changesets=$NEW_CHANGESETS" >> $GITHUB_OUTPUT
47+
48+
# Create version bump PR using changesets/action if there are new changesets
49+
- name: Changeset Pull Request
50+
if: steps.check-changesets.outputs.new_changesets != '0'
51+
id: changesets
52+
uses: changesets/action@v1
53+
with:
54+
commit: "changeset version bump"
55+
title: "Changeset version bump"
56+
version: npm run version-packages # This performs the changeset version bump
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.CROSS_REPO_ACCESS_TOKEN }}
59+
60+
# Job 2: Process version bump PR created by R00-B0T
61+
changeset-pr-approve-merge:
62+
name: Auto approve and merge Bump version PRs
63+
runs-on: ubuntu-latest
64+
permissions:
65+
contents: write
66+
pull-requests: write
67+
if: >
68+
github.event_name == 'pull_request' &&
69+
github.event.pull_request.base.ref == 'main' &&
70+
github.actor == 'R00-B0T' &&
71+
contains(github.event.pull_request.title, 'Changeset version bump')
72+
73+
steps:
74+
- name: Checkout Repo
75+
uses: actions/checkout@v4
76+
with:
77+
token: ${{ secrets.CROSS_REPO_ACCESS_TOKEN }}
78+
fetch-depth: 0
79+
ref: ${{ env.GIT_REF }}
80+
81+
# Auto-approve PR
82+
- name: Auto approve PR
83+
uses: hmarr/auto-approve-action@v4
84+
with:
85+
review-message: "I'm approving since it's a bump version PR"
86+
87+
# Enable auto-merge for the PR
88+
- name: Enable automerge on PR
89+
run: gh pr merge --squash --auto ${{ github.event.pull_request.number }}
90+
env:
91+
GH_TOKEN: ${{ secrets.CROSS_REPO_ACCESS_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ node_modules
88
# Builds
99
bin/
1010
roo-cline-*.vsix
11+
12+
# Local prompts and rules
13+
/local-prompts

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
},
173173
"devDependencies": {
174174
"@changesets/cli": "^2.27.10",
175+
"@changesets/types": "^6.0.0",
175176
"@types/diff": "^5.2.1",
176177
"@types/jest": "^29.5.14",
177178
"@types/mocha": "^10.0.7",

0 commit comments

Comments
 (0)