diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c096c37..fcc76a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,9 +7,15 @@ on: workflow_dispatch: pull_request: branches: ["main"] + paths: + - "website/**" permissions: contents: write +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" diff --git a/.github/workflows/capture-blog-ideas.yml b/.github/workflows/capture-blog-ideas.yml index fecf552..1df8bed 100644 --- a/.github/workflows/capture-blog-ideas.yml +++ b/.github/workflows/capture-blog-ideas.yml @@ -9,6 +9,10 @@ permissions: issues: write pull-requests: write +concurrency: + group: ${{ github.workflow }}-${{ github.event.issue.number || github.ref }} + cancel-in-progress: true + jobs: capture: if: contains(github.event.issue.labels.*.name, 'blog') diff --git a/.github/workflows/deploy-to-pages.yml b/.github/workflows/deploy-to-pages.yml index 05b8499..3490998 100644 --- a/.github/workflows/deploy-to-pages.yml +++ b/.github/workflows/deploy-to-pages.yml @@ -10,6 +10,10 @@ on: permissions: contents: write +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" diff --git a/.github/workflows/draft-weekly-blog-post.lock.yml b/.github/workflows/draft-weekly-blog-post.lock.yml index f554383..58a8498 100644 --- a/.github/workflows/draft-weekly-blog-post.lock.yml +++ b/.github/workflows/draft-weekly-blog-post.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"1073088c6ddad155fadddb7173b1b87d089c5729af25a6b985344f3a80e6fb52","body_hash":"e878be33dfe12fc63dfb47475e4f14a5368bae4a482ffe062dee4ef50fa4b743","compiler_version":"v0.89.21","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.87"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"878773957748478a4f0b2288a808e877a52b97a66f9f8f0ad7d3b61c50baeeac","body_hash":"0e1940bbed6528b08562096de6aa17b5f2cdc9a344b7fa11c49677c215add4d3","compiler_version":"v0.89.21","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.87"}} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_CI_TRIGGER_TOKEN","GH_AW_DEFAULT_OTLP_ENDPOINT","GH_AW_DEFAULT_OTLP_HEADERS","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"924af5fdc64061cfbf66fb584c8b07e2ac230c60","version":"v0.89.21"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.28.23","digest":"sha256:2c78aaba1c108e130e2d6d01e4f2cca334ea04c53e6f258913ac34173fe7e3b2","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.28.23@sha256:2c78aaba1c108e130e2d6d01e4f2cca334ea04c53e6f258913ac34173fe7e3b2"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.28.23","digest":"sha256:c15c3d1208df10c5b588a3657be53742aa982ae0909d1eb1812525268794ca64","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.28.23@sha256:c15c3d1208df10c5b588a3657be53742aa982ae0909d1eb1812525268794ca64"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.28.23","digest":"sha256:9e31a6e518eba44652b9ae94ce55c3b6958e06290c3b81b08de4174751bb439a","pinned_image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.28.23@sha256:9e31a6e518eba44652b9ae94ce55c3b6958e06290c3b81b08de4174751bb439a"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.28.23","digest":"sha256:02ffc56dd40158223064ef03a78c2d9717473c93723b4e403d455ea6f0b09ae0","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.28.23@sha256:02ffc56dd40158223064ef03a78c2d9717473c93723b4e403d455ea6f0b09ae0"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.25","digest":"sha256:9be0a86220e807a0ecc89e53d7453468f7a53fbc6b3d1efd2299025ffe01d086","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.25@sha256:9be0a86220e807a0ecc89e53d7453468f7a53fbc6b3d1efd2299025ffe01d086"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:11c2c544876cdbaffefe0f7f1283b74838c209654b4934a78e23ed11f750490f","pinned_image":"ghcr.io/github/gh-aw-node@sha256:11c2c544876cdbaffefe0f7f1283b74838c209654b4934a78e23ed11f750490f"},{"image":"ghcr.io/github/github-mcp-server:v1.12.2","digest":"sha256:508a0857ec762b1ab1cece29193345b501fab1dd9d1228a7b617062954cecac6","pinned_image":"ghcr.io/github/github-mcp-server:v1.12.2@sha256:508a0857ec762b1ab1cece29193345b501fab1dd9d1228a7b617062954cecac6"}],"mcp_servers":[{"name":"safeoutputs","tools":["add_comment","create_pull_request","missing_data","missing_tool","noop"]}]} # This file was automatically generated by gh-aw (v0.89.21). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -67,8 +67,8 @@ on: permissions: {} concurrency: - group: "gh-aw-${{ github.workflow }}" - queue: max + cancel-in-progress: true + group: gh-aw-${{ github.workflow }}-${{ github.ref }} run-name: "Draft weekly blog post" @@ -385,10 +385,7 @@ jobs: needs: activation if: needs.activation.outputs.daily_ai_credits_exceeded != 'true' runs-on: ubuntu-latest - permissions: - contents: read - issues: read - pull-requests: read + permissions: {} concurrency: group: "gh-aw-copilot-${{ github.workflow }}" queue: max @@ -412,7 +409,6 @@ jobs: ai_credits_rate_limit_error: ${{ steps.parse-mcp-gateway.outputs.ai_credits_rate_limit_error || 'false' }} aic: ${{ steps.parse-token-usage.outputs.aic }} ambient_context: ${{ steps.parse-token-usage.outputs.ambient_context }} - checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} has_patch: ${{ steps.collect_output.outputs.has_patch }} http_400_response_error: ${{ steps.detect-agent-errors.outputs.http_400_response_error || 'false' }} inference_access_error: ${{ steps.detect-agent-errors.outputs.inference_access_error || 'false' }} @@ -489,22 +485,6 @@ jobs: GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_TOKEN: ${{ github.token }} run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_git_credentials.sh" - - name: Checkout PR branch - id: checkout-pr - if: | - github.event.pull_request || github.event.issue.pull_request || github.event_name == 'workflow_dispatch' && fromJSON(github.event.inputs.aw_context || '{}').item_type == 'pull_request' - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - with: - github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - script: | - const path = require('path'); - const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions'); - const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs')); - setupGlobals(core, github, context, exec, io, getOctokit); - const { main } = require(path.join(actionsDir, 'checkout_pr_branch.cjs')); - await main(); - name: Install GitHub Copilot CLI run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" env: @@ -524,12 +504,6 @@ jobs: const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions'); const determineAutomaticLockdown = require(path.join(actionsDir, 'determine_automatic_lockdown.cjs')); await determineAutomaticLockdown(github, context, core); - - name: Restore agent config folders from base branch - if: steps.checkout-pr.outcome == 'success' - env: - GH_AW_AGENT_FOLDERS: ".agents .github" - GH_AW_AGENT_FILES: "AGENTS.md" - run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_base_github_folders.sh" - name: Restore inline sub-agents from activation artifact env: GH_AW_SUB_AGENT_DIR: ".github/agents" @@ -1422,7 +1396,6 @@ jobs: GH_AW_ENGINE_ID: "copilot" GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} GH_AW_ENGINE_SECRET_FAILURE_MESSAGE: "**Alternative**: If your organization has a Copilot subscription, you can avoid the need for a personal access token by adding a top-level `permissions` block to your workflow file. This enables Copilot inference through the org using the built-in GitHub Actions token.\n\n```yaml\npermissions:\n copilot-requests: write\n```\n\nSee: https://github.github.com/gh-aw/reference/engines/#github-copilot-default" - GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} GH_AW_AI_CREDITS_RATE_LIMIT_ERROR: ${{ needs.agent.outputs.ai_credits_rate_limit_error || 'false' }} GH_AW_UNKNOWN_MODEL_AI_CREDITS: ${{ needs.agent.outputs.unknown_model_ai_credits || 'false' }} GH_AW_AIC: ${{ needs.agent.outputs.aic }} diff --git a/.github/workflows/draft-weekly-blog-post.md b/.github/workflows/draft-weekly-blog-post.md index cd2f88b..81ad264 100644 --- a/.github/workflows/draft-weekly-blog-post.md +++ b/.github/workflows/draft-weekly-blog-post.md @@ -4,13 +4,13 @@ name: Draft weekly blog post description: Turn the oldest open blog issue and the repo’s recent activity into a narrative, reader-friendly blog draft for review. on: schedule: - - cron: "0 9 * * 3" + - cron: "0 9 * * 3" #wed 9am workflow_dispatch: -permissions: - contents: read - issues: read - pull-requests: read +permissions: {} strict: true +concurrency: + group: "gh-aw-${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true network: allowed: [defaults, github] tools: @@ -32,19 +32,36 @@ Draft a personal, engaging blog post from the oldest open `blog` issue in this r Use the repo’s actual activity as grounding, but write as a thoughtful editor and storyteller rather than as a changelog or issue list. The result should read like a real blog post that helps readers understand what changed, why it matters, and what the broader pattern suggests. +## Debug and logging + +Before drafting or creating a PR, log the trigger and issue selection state so a missed run is easy to diagnose. + +- `echo "event_name=${GITHUB_EVENT_NAME}"` +- `echo "ref=${GITHUB_REF}"` +- `echo "repository=${GITHUB_REPOSITORY}"` +- `echo "workflow_run_id=${GITHUB_RUN_ID}"` +- `gh issue list --label blog --state open --limit 20 --json number,title,url,createdAt` +- `gh issue list --label blog --state open --limit 20 --json number,title,url | jq -r '.[] | "Issue #\(.number): \(.title) | \(.url)"'` +- `gh run list --workflow "Draft weekly blog post" --limit 10` + +These commands should be emitted to workflow logs so if the action is skipped, silent, or fails before writing, the reason is visible in GitHub Actions output. + ## Workflow -1. Inspect the oldest open issue tagged `blog`. -2. Read the issue title, body, and any related repo context that helps explain the theme or story behind it. -3. Identify the core narrative arc: +1. Inspect all issues labeled with `blog` and log the current execution context before making any decisions. +2. Capture the selected issue list and confirm which issues are being included in the draft. +3. Read the issue title, body, and any related repo context that helps explain the theme or story behind it. +4. Identify the core narrative arc of each `blog` issue: - what problem or opportunity is being explored - why it matters in practical terms - what changed or what the reader should pay attention to - what a thoughtful close looks like -4. Draft a markdown blog body in first person with a warm, practical, editorial voice. -5. Make sure the post is grounded in the issue and repo facts only. Do not invent specific details or fabricate events. -6. Save the draft as a new markdown file in `website/blog/` using a date-based slug and a clear title. -7. Create a pull request for review when the draft is ready. +5. Draft a markdown blog body in first person with a warm, practical, editorial voice. +6. Make sure the post is grounded in the issue and repo facts only. Do not invent specific details or fabricate events. +7. Save the draft as a new markdown file in `website/blog/` using a date-based slug and a clear title. +8. Create a pull request for review when the draft is ready. +9. In the PR description, include `Related issues` with one line per included issue, using closing syntax to close them automatically when merged, for example `Closes #94`, `Closes #95`, and `Closes #96`. +10. Include a short executive summary before the issue list so the review PR makes sense even without reading the draft file. ## Writing standards diff --git a/.github/workflows/readme.md b/.github/workflows/readme.md new file mode 100644 index 0000000..c85ee32 --- /dev/null +++ b/.github/workflows/readme.md @@ -0,0 +1,29 @@ +# Notes on workflows + +## Compile agentic action into lock file + +``` +cd /Users/geraldinefberry/repos/project-dfberry/repos/dfberry.github.io-2 + +gh extension install github/gh-aw +gh aw compile --verbose +``` + +Note: If there’s a mismatch between the generated agentic workflow and the existing YAML files; that mismatch is often the reason scheduled runs silently skip. + +## When did the action last run + +``` +gh run list --workflow "Draft weekly blog post" +``` + +## Logging + +If we want to make debugging easier, the workflow should log: + +``` +echo "event=${GITHUB_EVENT_NAME}" +echo "ref=${GITHUB_REF}" +gh issue list --label blog --state open +echo "workflow path is on default branch?" +``` \ No newline at end of file