Skip to content

Commit c798c27

Browse files
authored
Merge branch 'main' into portal-accessibility-tweaks
2 parents 007906c + 1742cd0 commit c798c27

File tree

1,309 files changed

+30612
-22908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,309 files changed

+30612
-22908
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: add-private-feature-flag
3+
description: Use when adding a new private (developer experiments) feature flag to Ghost, including the backend registration and settings UI toggle.
4+
---
5+
6+
# Add Private Feature Flag
7+
8+
## Overview
9+
Adds a new private feature flag to Ghost. Private flags appear in Labs settings under the "Private features" tab, visible only when developer experiments are enabled.
10+
11+
## Steps
12+
13+
1. **Add the flag to `ghost/core/core/shared/labs.js`**
14+
- Add the flag name (camelCase string) to the `PRIVATE_FEATURES` array.
15+
16+
2. **Add a UI toggle in `apps/admin-x-settings/src/components/settings/advanced/labs/private-features.tsx`**
17+
- Add a new entry to the `features` array with `title`, `description`, and `flag` (must match the string in `labs.js`).
18+
19+
3. **Run tests and update the config API snapshot**
20+
- Unit: `cd ghost/core && yarn test:single test/unit/shared/labs.test.js`
21+
- Update snapshot and run e2e: `cd ghost/core && UPDATE_SNAPSHOTS=1 yarn test:single test/e2e-api/admin/config.test.js`
22+
- Review the diff of `ghost/core/test/e2e-api/admin/__snapshots__/config.test.js.snap` to confirm only your new flag was added.
23+
24+
## Notes
25+
- No database migration is needed. Labs flags are stored in a single JSON `labs` setting.
26+
- The flag name must be identical in `labs.js`, `private-features.tsx`, and the snapshot.
27+
- Flags are camelCase strings (e.g. `welcomeEmailDesignCustomization`).
28+
- For public beta flags (visible to all users), add to `PUBLIC_BETA_FEATURES` in `labs.js` instead and add the toggle to `apps/admin-x-settings/src/components/settings/advanced/labs/beta-features.tsx`.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY
2+
version = 1
3+
name = "Ghost"
4+
5+
[setup]
6+
script = '''
7+
git submodule update --init --recursive
8+
yarn
9+
'''

.env.example

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
# Debug level to pass to Ghost
1010
# DEBUG=
1111

12-
# App flags to pass to the dev command
13-
## Run `yarn dev --show-flags` to see all available app flags
14-
15-
# GHOST_DEV_APP_FLAGS=
16-
17-
# Stripe keys - used to forward Stripe webhooks to the Ghost instance in `dev.js` script
12+
# Stripe keys - used to forward Stripe webhooks to Ghost
1813
## Stripe Secret Key: sk_test_*******
1914
# STRIPE_SECRET_KEY=
2015
## Stripe Publishable Key: pk_test_*******
2116
#STRIPE_PUBLISHABLE_KEY=
2217
## Stripe Account ID: acct_1*******
2318
#STRIPE_ACCOUNT_ID=
19+
20+
# Mailgun SMTP credentials - used with `yarn dev:mailgun`
21+
## SMTP username from Mailgun (often starts with `postmaster@`)
22+
# MAILGUN_SMTP_USER=
23+
## SMTP password from Mailgun
24+
# MAILGUN_SMTP_PASS=

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
*.md text eol=lf
44
*.json text eol=lf
55
*.yml text eol=lf
6-
*.hbs text eol=lf
6+
*.hbs text eol=lf
7+
8+
.github/workflows/*.lock.yml linguist-generated=true merge=ours

.github/CODEOWNERS

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44

55
# E2E Test Ownership
66
# The top-level e2e directory requires review from designated owners
7-
/e2e/ @9larsons @cmraible @ibalosh
7+
/e2e/ @9larsons
88

99
# Tinybird Analytics
1010
# Tinybird data pipelines and services require review from designated owners
11-
**/tinybird/ @9larsons @cmraible @troyciesco
11+
**/tinybird/ @9larsons @cmraible @evanhahn @troyciesco
12+
13+
# @tryghost/parse-email-address
14+
/ghost/parse-email-address/ @EvanHahn
15+
16+
# Inbox Links
17+
ghost/core/core/server/lib/get-inbox-links.ts @EvanHahn
18+
ghost/core/test/unit/server/lib/get-inbox-links.test.ts @EvanHahn

.github/actions/load-docker-image/action.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,45 @@
11
name: 'Load Docker Image'
22
description: 'Load Docker image from registry or artifact based on build source'
33
inputs:
4-
is-fork:
5-
description: 'Whether this is a fork PR build'
4+
use-artifact:
5+
description: 'Whether to load the image from an artifact (true) or pull from GHCR (false)'
66
required: true
77
image-tags:
88
description: 'Docker image tags (multi-line string)'
99
required: true
10+
artifact-name:
11+
description: 'Name of the artifact to download (fork PRs only)'
12+
required: false
13+
default: 'docker-image'
1014

1115
runs:
1216
using: 'composite'
1317
steps:
14-
- name: Download image artifact (fork PR)
15-
if: inputs.is-fork == 'true'
18+
- name: Download image artifact (artifact)
19+
if: inputs.use-artifact == 'true'
1620
uses: actions/download-artifact@v4
1721
with:
18-
name: docker-image
22+
name: ${{ inputs.artifact-name }}
1923

20-
- name: Load image from artifact (fork PR)
21-
if: inputs.is-fork == 'true'
24+
- name: Load image from artifact (artifact)
25+
if: inputs.use-artifact == 'true'
2226
shell: bash
2327
run: |
2428
echo "Loading Docker image from artifact..."
25-
gunzip -c docker-image.tar.gz | docker load
29+
gunzip -c ${{ inputs.artifact-name }}.tar.gz | docker load
2630
echo "Available images after load:"
2731
docker images
2832
2933
- name: Log in to GitHub Container Registry
30-
if: inputs.is-fork == 'false'
34+
if: inputs.use-artifact == 'false'
3135
uses: docker/login-action@v3
3236
with:
3337
registry: ghcr.io
3438
username: ${{ github.actor }}
3539
password: ${{ github.token }}
3640

3741
- name: Pull image from registry (main repo/branch)
38-
if: inputs.is-fork == 'false'
42+
if: inputs.use-artifact == 'false'
3943
shell: bash
4044
run: |
4145
IMAGE_TAG=$(echo "${{ inputs.image-tags }}" | head -n1)
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
---
2+
description: GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing
3+
disable-model-invocation: true
4+
---
5+
6+
# GitHub Agentic Workflows Agent
7+
8+
This agent helps you work with **GitHub Agentic Workflows (gh-aw)**, a CLI extension for creating AI-powered workflows in natural language using markdown files.
9+
10+
## What This Agent Does
11+
12+
This is a **dispatcher agent** that routes your request to the appropriate specialized prompt based on your task:
13+
14+
- **Creating new workflows**: Routes to `create` prompt
15+
- **Updating existing workflows**: Routes to `update` prompt
16+
- **Debugging workflows**: Routes to `debug` prompt
17+
- **Upgrading workflows**: Routes to `upgrade-agentic-workflows` prompt
18+
- **Creating shared components**: Routes to `create-shared-agentic-workflow` prompt
19+
- **Fixing Dependabot PRs**: Routes to `dependabot` prompt — use this when Dependabot opens PRs that modify generated manifest files (`.github/workflows/package.json`, `.github/workflows/requirements.txt`, `.github/workflows/go.mod`). Never merge those PRs directly; instead update the source `.md` files and rerun `gh aw compile --dependabot` to bundle all fixes
20+
21+
Workflows may optionally include:
22+
23+
- **Project tracking / monitoring** (GitHub Projects updates, status reporting)
24+
- **Orchestration / coordination** (one workflow assigning agents or dispatching and coordinating other workflows)
25+
26+
## Files This Applies To
27+
28+
- Workflow files: `.github/workflows/*.md` and `.github/workflows/**/*.md`
29+
- Workflow lock files: `.github/workflows/*.lock.yml`
30+
- Shared components: `.github/workflows/shared/*.md`
31+
- Configuration: https://github.com/github/gh-aw/blob/v0.49.3/.github/aw/github-agentic-workflows.md
32+
33+
## Problems This Solves
34+
35+
- **Workflow Creation**: Design secure, validated agentic workflows with proper triggers, tools, and permissions
36+
- **Workflow Debugging**: Analyze logs, identify missing tools, investigate failures, and fix configuration issues
37+
- **Version Upgrades**: Migrate workflows to new gh-aw versions, apply codemods, fix breaking changes
38+
- **Component Design**: Create reusable shared workflow components that wrap MCP servers
39+
40+
## How to Use
41+
42+
When you interact with this agent, it will:
43+
44+
1. **Understand your intent** - Determine what kind of task you're trying to accomplish
45+
2. **Route to the right prompt** - Load the specialized prompt file for your task
46+
3. **Execute the task** - Follow the detailed instructions in the loaded prompt
47+
48+
## Available Prompts
49+
50+
### Create New Workflow
51+
**Load when**: User wants to create a new workflow from scratch, add automation, or design a workflow that doesn't exist yet
52+
53+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.49.3/.github/aw/create-agentic-workflow.md
54+
55+
**Use cases**:
56+
- "Create a workflow that triages issues"
57+
- "I need a workflow to label pull requests"
58+
- "Design a weekly research automation"
59+
60+
### Update Existing Workflow
61+
**Load when**: User wants to modify, improve, or refactor an existing workflow
62+
63+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.49.3/.github/aw/update-agentic-workflow.md
64+
65+
**Use cases**:
66+
- "Add web-fetch tool to the issue-classifier workflow"
67+
- "Update the PR reviewer to use discussions instead of issues"
68+
- "Improve the prompt for the weekly-research workflow"
69+
70+
### Debug Workflow
71+
**Load when**: User needs to investigate, audit, debug, or understand a workflow, troubleshoot issues, analyze logs, or fix errors
72+
73+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.49.3/.github/aw/debug-agentic-workflow.md
74+
75+
**Use cases**:
76+
- "Why is this workflow failing?"
77+
- "Analyze the logs for workflow X"
78+
- "Investigate missing tool calls in run #12345"
79+
80+
### Upgrade Agentic Workflows
81+
**Load when**: User wants to upgrade workflows to a new gh-aw version or fix deprecations
82+
83+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.49.3/.github/aw/upgrade-agentic-workflows.md
84+
85+
**Use cases**:
86+
- "Upgrade all workflows to the latest version"
87+
- "Fix deprecated fields in workflows"
88+
- "Apply breaking changes from the new release"
89+
90+
### Create Shared Agentic Workflow
91+
**Load when**: User wants to create a reusable workflow component or wrap an MCP server
92+
93+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.49.3/.github/aw/create-shared-agentic-workflow.md
94+
95+
**Use cases**:
96+
- "Create a shared component for Notion integration"
97+
- "Wrap the Slack MCP server as a reusable component"
98+
- "Design a shared workflow for database queries"
99+
100+
### Fix Dependabot PRs
101+
**Load when**: User needs to close or fix open Dependabot PRs that update dependencies in generated manifest files (`.github/workflows/package.json`, `.github/workflows/requirements.txt`, `.github/workflows/go.mod`)
102+
103+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.49.3/.github/aw/dependabot.md
104+
105+
**Use cases**:
106+
- "Fix the open Dependabot PRs for npm dependencies"
107+
- "Bundle and close the Dependabot PRs for workflow dependencies"
108+
- "Update @playwright/test to fix the Dependabot PR"
109+
110+
## Instructions
111+
112+
When a user interacts with you:
113+
114+
1. **Identify the task type** from the user's request
115+
2. **Load the appropriate prompt** from the GitHub repository URLs listed above
116+
3. **Follow the loaded prompt's instructions** exactly
117+
4. **If uncertain**, ask clarifying questions to determine the right prompt
118+
119+
## Quick Reference
120+
121+
```bash
122+
# Initialize repository for agentic workflows
123+
gh aw init
124+
125+
# Generate the lock file for a workflow
126+
gh aw compile [workflow-name]
127+
128+
# Debug workflow runs
129+
gh aw logs [workflow-name]
130+
gh aw audit <run-id>
131+
132+
# Upgrade workflows
133+
gh aw fix --write
134+
gh aw compile --validate
135+
```
136+
137+
## Key Features of gh-aw
138+
139+
- **Natural Language Workflows**: Write workflows in markdown with YAML frontmatter
140+
- **AI Engine Support**: Copilot, Claude, Codex, or custom engines
141+
- **MCP Server Integration**: Connect to Model Context Protocol servers for tools
142+
- **Safe Outputs**: Structured communication between AI and GitHub API
143+
- **Strict Mode**: Security-first validation and sandboxing
144+
- **Shared Components**: Reusable workflow building blocks
145+
- **Repo Memory**: Persistent git-backed storage for agents
146+
- **Sandboxed Execution**: All workflows run in the Agent Workflow Firewall (AWF) sandbox, enabling full `bash` and `edit` tools by default
147+
148+
## Important Notes
149+
150+
- Always reference the instructions file at https://github.com/github/gh-aw/blob/v0.49.3/.github/aw/github-agentic-workflows.md for complete documentation
151+
- Use the MCP tool `agentic-workflows` when running in GitHub Copilot Cloud
152+
- Workflows must be compiled to `.lock.yml` files before running in GitHub Actions
153+
- **Bash tools are enabled by default** - Don't restrict bash commands unnecessarily since workflows are sandboxed by the AWF
154+
- Follow security best practices: minimal permissions, explicit network access, no template injection
155+
- **Single-file output**: When creating a workflow, produce exactly **one** workflow `.md` file. Do not create separate documentation files (architecture docs, runbooks, usage guides, etc.). If documentation is needed, add a brief `## Usage` section inside the workflow file itself.

.github/aw/actions-lock.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"entries": {
3+
"actions/github-script@v8": {
4+
"repo": "actions/github-script",
5+
"version": "v8",
6+
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
7+
},
8+
"github/gh-aw/actions/setup@v0.51.5": {
9+
"repo": "github/gh-aw/actions/setup",
10+
"version": "v0.51.5",
11+
"sha": "88319be75ab1adc60640307a10e5cf04b3deff1e"
12+
}
13+
}
14+
}

.github/scripts/bump-version.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ const semver = require('semver');
2323
const bumpedVersion = semver.inc(current_version, 'minor');
2424
newVersion = `${bumpedVersion}-pre-g${buildString}`;
2525
} else {
26-
const gitVersion = await exec('git describe --long HEAD').then(({stdout}) => stdout.trim().replace(/^v/, ''));
27-
newVersion = gitVersion;
26+
newVersion = `${current_version}-0-g${buildString}`;
2827
}
2928

3029
newVersion += '+moya';

.github/scripts/check-app-version-bump.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,15 @@ function compareSemver(a, b) {
159159
}
160160

161161
function getChangedFiles(baseSha, compareSha) {
162-
return runGit(['diff', '--name-only', baseSha, compareSha, '--', ...MONITORED_APP_PATHS])
162+
let mergeBaseSha;
163+
164+
try {
165+
mergeBaseSha = runGit(['merge-base', baseSha, compareSha]);
166+
} catch (error) {
167+
throw new Error(`Unable to determine merge-base for ${baseSha} and ${compareSha}. Ensure the base branch history is available in the checkout.\n${error.message}`);
168+
}
169+
170+
return runGit(['diff', '--name-only', mergeBaseSha, compareSha, '--', ...MONITORED_APP_PATHS])
163171
.split('\n')
164172
.map(file => file.trim())
165173
.filter(Boolean);

0 commit comments

Comments
 (0)