code-foundry 0.18.0 → 0.19.0

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.
@@ -284,6 +284,7 @@ files=("${filtered_files[@]}")
284
284
  standard_workflow() {
285
285
  case "$1" in
286
286
  ci.yml|codeql.yml|draft-pr.yml|release-pr.yml|release.yml|security.yml|test.yml) return 0 ;;
287
+ reusable-draft-pr.yml|reusable-release-pr.yml) return 0 ;;
287
288
  *) return 1 ;;
288
289
  esac
289
290
  }
@@ -0,0 +1,51 @@
1
+ name: Code Foundry Draft PR
2
+
3
+ on:
4
+ workflow_call:
5
+
6
+ permissions:
7
+ contents: read
8
+ pull-requests: write
9
+
10
+ env:
11
+ GH_TOKEN: ${{ github.token }}
12
+
13
+ jobs:
14
+ create-draft-pr:
15
+ name: Create
16
+ runs-on: ubuntu-slim
17
+ timeout-minutes: 10
18
+ concurrency:
19
+ group: ${{ github.workflow }}-${{ github.ref }}
20
+ cancel-in-progress: true
21
+ steps:
22
+ - name: Check
23
+ id: check-pr
24
+ run: |
25
+ BRANCH="${{ github.ref_name }}"
26
+ EXISTING=$(gh pr list --limit 1 --base staging --head "$BRANCH" --state open --json number,title 2>/dev/null | jq 'length')
27
+ echo "existing=$EXISTING" >> "$GITHUB_OUTPUT"
28
+
29
+ - name: Create
30
+ if: steps.check-pr.outputs.existing == '0'
31
+ run: |
32
+ BRANCH="${{ github.ref_name }}"
33
+ gh pr create \
34
+ --base staging \
35
+ --head "$BRANCH" \
36
+ --draft \
37
+ --title "[WIP] $BRANCH" \
38
+ --body "Draft PR created automatically by CI.
39
+
40
+ This PR is a draft and should not be merged until CI passes and a reviewer (or the Daily Review agent) marks it ready.
41
+
42
+ **CI Status:** Pending — this workflow triggered on push to \`$BRANCH\`."
43
+
44
+ - name: Mark ready
45
+ if: steps.check-pr.outputs.existing == '0'
46
+ run: |
47
+ BRANCH="${{ github.ref_name }}"
48
+ PR_NUMBER=$(gh pr list --limit 1 --base staging --head "$BRANCH" --state open --json number 2>/dev/null | jq '.[0].number')
49
+ if [ -n "$PR_NUMBER" ]; then
50
+ gh pr ready "$PR_NUMBER"
51
+ fi
@@ -0,0 +1,86 @@
1
+ name: Code Foundry Release PR
2
+
3
+ on:
4
+ workflow_call:
5
+
6
+ permissions:
7
+ contents: read
8
+ pull-requests: write
9
+
10
+ env:
11
+ GH_TOKEN: ${{ github.token }}
12
+
13
+ jobs:
14
+ create-release-pr:
15
+ name: Create
16
+ runs-on: ubuntu-slim
17
+ timeout-minutes: 10
18
+ concurrency:
19
+ group: ${{ github.workflow }}-${{ github.ref }}
20
+ cancel-in-progress: true
21
+ steps:
22
+ - name: Check
23
+ id: check-pr
24
+ run: |
25
+ set -euo pipefail
26
+ EXISTING=$(gh pr list \
27
+ --repo "$GITHUB_REPOSITORY" \
28
+ --limit 1 \
29
+ --base main \
30
+ --head staging \
31
+ --state open \
32
+ --json number | jq 'length')
33
+ echo "existing=$EXISTING" >> "$GITHUB_OUTPUT"
34
+
35
+ - name: Create
36
+ if: steps.check-pr.outputs.existing == '0'
37
+ run: |
38
+ DATE=$(date +%Y-%m-%d)
39
+ BODY_FILE="$RUNNER_TEMP/release-pr.md"
40
+ COMPARE_URL="repos/${GITHUB_REPOSITORY}/compare/main...staging"
41
+ COMPARE_FILE="$RUNNER_TEMP/release-compare.json"
42
+ gh api "$COMPARE_URL?per_page=100" > "$COMPARE_FILE"
43
+ TOTAL_COMMITS=$(jq -r '.total_commits // 0' "$COMPARE_FILE")
44
+ if [ "$TOTAL_COMMITS" -gt 100 ]; then
45
+ LAST_PAGE=$(( (TOTAL_COMMITS + 99) / 100 ))
46
+ gh api "$COMPARE_URL?per_page=100&page=$LAST_PAGE" > "$COMPARE_FILE"
47
+ fi
48
+ COMMITS=$(jq -r '.commits[] | "- \(.commit.message | split("\\n")[0]) (\(.sha[0:7]))"' "$COMPARE_FILE")
49
+ if [ -z "$COMMITS" ]; then
50
+ COMMITS='- No commits found since main.'
51
+ fi
52
+
53
+ if [ "$TOTAL_COMMITS" -eq 1 ]; then
54
+ CHANGE_LABEL=change
55
+ else
56
+ CHANGE_LABEL=changes
57
+ fi
58
+
59
+ cat > "$BODY_FILE" <<EOF
60
+ ## Environment promotion
61
+
62
+ Promote the validated \`staging\` environment into \`main\`.
63
+ This is a deployment-promotion PR, not the version-release PR.
64
+
65
+ - **Source:** \`staging\`
66
+ - **Target:** \`main\`
67
+ - **Changes:** $TOTAL_COMMITS $CHANGE_LABEL
68
+ - **Created:** $DATE
69
+
70
+ ### Commit summary
71
+
72
+ $COMMITS
73
+
74
+ ### Validation
75
+
76
+ - Required CI, test, security, and CodeQL checks must pass before merge.
77
+ - Merge with **rebase** to preserve the linear Conventional Commit history.
78
+ - After merge, Release Please opens a separate versioned release PR with the changelog.
79
+ EOF
80
+
81
+ gh pr create \
82
+ --repo "$GITHUB_REPOSITORY" \
83
+ --base main \
84
+ --head staging \
85
+ --title "Promote staging -> main ($DATE)" \
86
+ --body-file "$BODY_FILE"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.19.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.18.0...v0.19.0) (2026-07-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * **workflows:** add reusable promotion runtimes ([ac113a9](https://github.com/0xPlayerOne/code-foundry/commit/ac113a902700957cbf26d4a47b4e7828b157dd13))
9
+
3
10
  ## [0.18.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.17.0...v0.18.0) (2026-07-28)
4
11
 
5
12
 
package/README.md CHANGED
@@ -61,6 +61,11 @@ main-branch wrapper while the shared runtime handles Release Please, GitHub
61
61
  release metadata, optional npm publication, provenance, and token/trusted
62
62
  publishing fallback.
63
63
 
64
+ The promotion runtimes for Draft PR and Release PR are maintained in the same
65
+ versioned repository. They are introduced before their consumer wrappers move
66
+ to a release tag, avoiding a bootstrap cycle when a new runtime version is
67
+ being published.
68
+
64
69
  Initialization defaults to AGPL for new repositories. Synchronization defaults
65
70
  to `--license preserve`, so an existing repository's license is never replaced
66
71
  unless you explicitly select a license or provide `--license-file`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",