Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/actions/create-workflow-failure-issue/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Create workflow failure issue
description: Create or update a GitHub issue in docs-engineering when a workflow fails, for automated diagnosis by an agentic workflow.

inputs:
token:
description: A token with issues write permission on the target repo
required: true
repo:
description: The repository to create the issue in
default: github/docs-engineering
required: false

runs:
using: composite
steps:
- name: Check for existing open issue
id: check-existing
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}
ISSUE_REPO: ${{ inputs.repo }}
WORKFLOW_NAME: ${{ github.workflow }}
run: |
existing=$(gh issue list \
--repo "$ISSUE_REPO" \
--label "workflow-failure" \
--search "in:title [Workflow Failure] $WORKFLOW_NAME" \
--state open \
--json number \
--jq '.[0].number // empty' 2>/dev/null || true)
echo "existing_issue=$existing" >> "$GITHUB_OUTPUT"

- name: Comment on existing issue
if: steps.check-existing.outputs.existing_issue != ''
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}
ISSUE_REPO: ${{ inputs.repo }}
ISSUE_NUMBER: ${{ steps.check-existing.outputs.existing_issue }}
WORKFLOW_NAME: ${{ github.workflow }}
SOURCE_REPO: ${{ github.repository }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
EVENT_NAME: ${{ github.event_name }}
GIT_REF: ${{ github.ref }}
run: |
body=$(cat <<EOF
### Repeat failure

**Workflow:** \`$WORKFLOW_NAME\`
**Repository:** \`$SOURCE_REPO\`
**Run:** $RUN_URL
**Event:** \`$EVENT_NAME\`
**Ref:** \`$GIT_REF\`
**Timestamp:** $(date -u +%Y-%m-%dT%H:%M:%SZ)
EOF
)
gh issue comment "$ISSUE_NUMBER" \
--repo "$ISSUE_REPO" \
--body "$body"

- name: Create workflow failure issue
if: steps.check-existing.outputs.existing_issue == ''
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}
ISSUE_REPO: ${{ inputs.repo }}
WORKFLOW_NAME: ${{ github.workflow }}
SOURCE_REPO: ${{ github.repository }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
EVENT_NAME: ${{ github.event_name }}
GIT_REF: ${{ github.ref }}
ACTOR: ${{ github.actor }}
run: |
body=$(cat <<EOF
### Workflow failure

**Workflow:** \`$WORKFLOW_NAME\`
**Repository:** \`$SOURCE_REPO\`
**Run:** $RUN_URL
**Event:** \`$EVENT_NAME\`
**Ref:** \`$GIT_REF\`
**Triggered by:** \`$ACTOR\`
**Timestamp:** $(date -u +%Y-%m-%dT%H:%M:%SZ)

---
This issue was automatically created by the create-workflow-failure-issue action to enable automated diagnosis.
EOF
)
gh issue create \
--repo "$ISSUE_REPO" \
--label "workflow-failure" \
--title "[Workflow Failure] $WORKFLOW_NAME" \
--body "$body"
9 changes: 9 additions & 0 deletions .github/instructions/all.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ When you create a pull request:
3. Label with "llm-generated".
4. If an issue exists, include "fixes owner/repo#issue" or "towards owner/repo#issue" as appropriate.
5. Always create PRs in **draft mode** using `--draft` flag.

## Accessing docs.github.com content programmatically

When you need to read GitHub Docs, use these endpoints on `docs.github.com` in order of preference:

1. `/llms.txt` — Start here. Returns a structured overview of the site with links to pagelist endpoints for each product version.
2. `/api/pagelist/:lang/:version` — Returns a list of all pages for a given language and version (e.g., `/api/pagelist/en/free-pro-team@latest`). Use `/api/pagelist/versions` and `/api/pagelist/languages` for available options.
3. `/api/search/v1?query=...&language=...&version=...&client_name=...` — Search docs content (e.g., `/api/search/v1?query=actions&language=en&version=free-pro-team@latest&client_name=copilot`).
4. `/api/article/body?pathname=...` — Returns the rendered markdown body of a page. Handles all page types including REST, GraphQL, and webhook reference pages.
5 changes: 5 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'pull_request' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
5 changes: 5 additions & 0 deletions .github/workflows/content-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
5 changes: 5 additions & 0 deletions .github/workflows/create-changelog-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
7 changes: 6 additions & 1 deletion .github/workflows/delete-orphan-translation-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: Delete orphan translation files
on:
workflow_dispatch:
schedule:
- cron: '20 16 * * 3' # Run every Wednesday at 16:20 UTC / 8:20 PST — orphan & hygiene cleanup theme
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST

permissions:
contents: write
Expand Down Expand Up @@ -140,3 +140,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
5 changes: 5 additions & 0 deletions .github/workflows/docs-review-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
7 changes: 6 additions & 1 deletion .github/workflows/enterprise-dates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: Enterprise date updater
on:
workflow_dispatch:
schedule:
- cron: '20 16 * * 4' # Run every Thursday at 16:20 UTC / 8:20 PST — infrastructure & releases theme
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST

permissions:
contents: write
Expand Down Expand Up @@ -74,3 +74,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
7 changes: 6 additions & 1 deletion .github/workflows/enterprise-release-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Open Enterprise release or deprecation issue
on:
workflow_dispatch:
schedule:
- cron: '20 16 * * 4' # Run every Thursday at 16:20 UTC / 8:20 PST — infrastructure & releases theme
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST

permissions:
contents: read
Expand Down Expand Up @@ -38,3 +38,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
5 changes: 5 additions & 0 deletions .github/workflows/index-autocomplete-search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name == 'schedule' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
15 changes: 15 additions & 0 deletions .github/workflows/index-general-search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}

updateElasticsearchIndexes:
needs: figureOutMatrix
name: Update indexes
Expand Down Expand Up @@ -244,6 +249,11 @@ jobs:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}

notifyScrapingFailures:
name: Notify scraping failures
needs: updateElasticsearchIndexes
Expand Down Expand Up @@ -291,3 +301,8 @@ jobs:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
message: ${{ fromJSON(steps.aggregate.outputs.result).message }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
5 changes: 5 additions & 0 deletions .github/workflows/keep-caches-warm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
7 changes: 6 additions & 1 deletion .github/workflows/link-check-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Link Check: External'

on:
schedule:
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST — link & content quality theme
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST
workflow_dispatch:
inputs:
max_urls:
Expand Down Expand Up @@ -82,3 +82,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
7 changes: 6 additions & 1 deletion .github/workflows/link-check-github-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: 'Link Check: github/github'
on:
workflow_dispatch:
schedule:
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST — link & content quality theme
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST

permissions:
contents: read
Expand Down Expand Up @@ -76,3 +76,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
18 changes: 17 additions & 1 deletion .github/workflows/link-check-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Link Check: Internal'

on:
schedule:
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST — link & content quality theme
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST
workflow_dispatch:
inputs:
version:
Expand Down Expand Up @@ -53,6 +53,11 @@ jobs:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}

check-internal-links:
if: github.repository == 'github/docs-internal'
needs: setup-matrix
Expand Down Expand Up @@ -102,12 +107,18 @@ jobs:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}

# Create combined report after all matrix jobs complete
create-report:
if: always() && github.repository == 'github/docs-internal'
needs: [setup-matrix, check-internal-links]
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout
Expand Down Expand Up @@ -162,3 +173,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
7 changes: 6 additions & 1 deletion .github/workflows/lint-entire-content-data-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: 'Lint entire content and data markdown files'
on:
workflow_dispatch:
schedule:
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST — link & content quality theme
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST

permissions:
contents: read
Expand Down Expand Up @@ -48,3 +48,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
7 changes: 6 additions & 1 deletion .github/workflows/moda-allowed-ips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Update Moda allowed IPs

on:
schedule:
- cron: '20 16 * * 4' # Run every Thursday at 16:20 UTC / 8:20 PST — infrastructure & releases theme
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -58,3 +58,8 @@ jobs:
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
2 changes: 1 addition & 1 deletion .github/workflows/needs-sme-stale-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Stale check for issues or PRs with "needs SME" label

on:
schedule:
- cron: '20 16 * * 2' # Run every Tuesday at 16:20 UTC / 8:20 PST — staleness & triage theme
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/no-response.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
types: [created]

schedule:
- cron: '20 16 * * 2' # Run every Tuesday at 16:20 UTC / 8:20 PST — staleness & triage theme
- cron: '20 16 * * 1' # Run every Monday at 16:20 UTC / 8:20 PST

permissions:
contents: read
Expand Down
Loading