code-foundry 0.27.16 → 0.27.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +74 -0
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
|
@@ -79,6 +79,80 @@ jobs:
|
|
|
79
79
|
token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
|
|
80
80
|
config-file: release-please-config.json
|
|
81
81
|
release-type: ${{ steps.profile.outputs.legacy_release_type }}
|
|
82
|
+
- name: Merge generated version pull requests
|
|
83
|
+
if: steps.release.outputs.prs_created == 'true'
|
|
84
|
+
env:
|
|
85
|
+
GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
|
|
86
|
+
run: |
|
|
87
|
+
set -euo pipefail
|
|
88
|
+
|
|
89
|
+
allowed_paths="$(
|
|
90
|
+
node <<'NODE'
|
|
91
|
+
const fs = require('node:fs')
|
|
92
|
+
const config = JSON.parse(fs.readFileSync('release-please-config.json', 'utf8'))
|
|
93
|
+
const common = [
|
|
94
|
+
'.release-please-manifest.json',
|
|
95
|
+
'CHANGELOG.md',
|
|
96
|
+
'Cargo.lock',
|
|
97
|
+
'Cargo.toml',
|
|
98
|
+
'bun.lock',
|
|
99
|
+
'bun.lockb',
|
|
100
|
+
'package-lock.json',
|
|
101
|
+
'package.json',
|
|
102
|
+
'pnpm-lock.yaml',
|
|
103
|
+
'pyproject.toml',
|
|
104
|
+
'uv.lock',
|
|
105
|
+
'version.txt',
|
|
106
|
+
'yarn.lock',
|
|
107
|
+
]
|
|
108
|
+
const allowed = new Set(common)
|
|
109
|
+
const addExtraFiles = (files = [], prefix = '') => {
|
|
110
|
+
for (const entry of files) {
|
|
111
|
+
const path = typeof entry === 'string' ? entry : entry.path
|
|
112
|
+
if (path) allowed.add(prefix ? `${prefix}/${path}` : path)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
addExtraFiles(config['extra-files'])
|
|
116
|
+
for (const [directory, packageConfig] of Object.entries(config.packages || {})) {
|
|
117
|
+
const prefix = directory === '.' ? '' : directory.replace(/\/$/, '')
|
|
118
|
+
for (const path of common) allowed.add(prefix ? `${prefix}/${path}` : path)
|
|
119
|
+
addExtraFiles(packageConfig['extra-files'], prefix)
|
|
120
|
+
}
|
|
121
|
+
process.stdout.write(JSON.stringify([...allowed]))
|
|
122
|
+
NODE
|
|
123
|
+
)"
|
|
124
|
+
|
|
125
|
+
mapfile -t release_prs < <(
|
|
126
|
+
gh pr list \
|
|
127
|
+
--repo "$GITHUB_REPOSITORY" \
|
|
128
|
+
--state open \
|
|
129
|
+
--base main \
|
|
130
|
+
--json number,title,headRefName \
|
|
131
|
+
--jq '.[] | select(.title | startswith("chore(main): release ")) | select(.headRefName | startswith("release-please--branches--main")) | .number'
|
|
132
|
+
)
|
|
133
|
+
[ "${#release_prs[@]}" -gt 0 ] || {
|
|
134
|
+
echo "Release Please reported a pull request, but no generated release PR was found." >&2
|
|
135
|
+
exit 1
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
for pr in "${release_prs[@]}"; do
|
|
139
|
+
mapfile -t changed_paths < <(gh pr diff "$pr" --repo "$GITHUB_REPOSITORY" --name-only)
|
|
140
|
+
[ "${#changed_paths[@]}" -gt 0 ] || {
|
|
141
|
+
echo "Generated release PR #$pr has no changed files." >&2
|
|
142
|
+
exit 1
|
|
143
|
+
}
|
|
144
|
+
for path in "${changed_paths[@]}"; do
|
|
145
|
+
jq -e --arg path "$path" 'index($path) != null' <<<"$allowed_paths" >/dev/null || {
|
|
146
|
+
echo "Refusing to auto-merge release PR #$pr with unexpected path: $path" >&2
|
|
147
|
+
exit 1
|
|
148
|
+
}
|
|
149
|
+
done
|
|
150
|
+
gh pr merge "$pr" \
|
|
151
|
+
--repo "$GITHUB_REPOSITORY" \
|
|
152
|
+
--admin \
|
|
153
|
+
--rebase \
|
|
154
|
+
--delete-branch
|
|
155
|
+
done
|
|
82
156
|
|
|
83
157
|
npm:
|
|
84
158
|
name: Release / Publish npm
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.27.17](https://github.com/0xPlayerOne/code-foundry/compare/v0.27.16...v0.27.17) (2026-07-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **release:** auto-merge generated version PRs ([3032cfc](https://github.com/0xPlayerOne/code-foundry/commit/3032cfc458e4508ad637354ee98447c544a5a1d4))
|
|
9
|
+
|
|
3
10
|
## [0.27.16](https://github.com/0xPlayerOne/code-foundry/compare/v0.27.15...v0.27.16) (2026-07-29)
|
|
4
11
|
|
|
5
12
|
### Bug Fixes
|
package/package.json
CHANGED