Skip to content

Commit a3ca2c1

Browse files
Merge branch 'main' into patch-1
2 parents 928a559 + 788df65 commit a3ca2c1

File tree

4,826 files changed

+7830586
-6398635
lines changed

Some content is hidden

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

4,826 files changed

+7830586
-6398635
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"ghcr.io/devcontainers/features/copilot-cli:1": {
1616
"version": "prerelease"
1717
},
18-
"ghcr.io/devcontainers/features/github-cli:1": {}
18+
"ghcr.io/devcontainers/features/github-cli:1": {},
19+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
1920
},
2021

2122
"customizations": {

.gitattributes

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Set default behavior, in case users don't have core.autocrlf set.
22
* text=auto
3-
# Explicitly declare text files we want to always be normalized and converted
4-
# to native line endings on checkout.
5-
*.md text diff=markdown
3+
# Explicitly declare text files we want to always be normalized, and for
4+
# Markdown files, enforce LF line endings on checkout.
5+
*.md text eol=lf diff=markdown
66
*.json.br filter=lfs diff=lfs merge=lfs -text
7+
.github/workflows/*.lock.yml linguist-generated=true merge=ours
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Create workflow failure issue
2+
description: Create or update a GitHub issue in docs-engineering when a workflow fails, for automated diagnosis by an agentic workflow.
3+
4+
inputs:
5+
token:
6+
description: A token with issues write permission on the target repo
7+
required: true
8+
repo:
9+
description: The repository to create the issue in
10+
default: github/docs-engineering
11+
required: false
12+
13+
runs:
14+
using: composite
15+
steps:
16+
- name: Check for existing open issue
17+
id: check-existing
18+
shell: bash
19+
env:
20+
GH_TOKEN: ${{ inputs.token }}
21+
ISSUE_REPO: ${{ inputs.repo }}
22+
WORKFLOW_NAME: ${{ github.workflow }}
23+
run: |
24+
existing=$(gh issue list \
25+
--repo "$ISSUE_REPO" \
26+
--label "workflow-failure" \
27+
--search "in:title [Workflow Failure] $WORKFLOW_NAME" \
28+
--state open \
29+
--json number \
30+
--jq '.[0].number // empty' 2>/dev/null || true)
31+
echo "existing_issue=$existing" >> "$GITHUB_OUTPUT"
32+
33+
- name: Comment on existing issue
34+
if: steps.check-existing.outputs.existing_issue != ''
35+
shell: bash
36+
env:
37+
GH_TOKEN: ${{ inputs.token }}
38+
ISSUE_REPO: ${{ inputs.repo }}
39+
ISSUE_NUMBER: ${{ steps.check-existing.outputs.existing_issue }}
40+
WORKFLOW_NAME: ${{ github.workflow }}
41+
SOURCE_REPO: ${{ github.repository }}
42+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
43+
EVENT_NAME: ${{ github.event_name }}
44+
GIT_REF: ${{ github.ref }}
45+
run: |
46+
body=$(cat <<EOF
47+
### Repeat failure
48+
49+
**Workflow:** \`$WORKFLOW_NAME\`
50+
**Repository:** \`$SOURCE_REPO\`
51+
**Run:** $RUN_URL
52+
**Event:** \`$EVENT_NAME\`
53+
**Ref:** \`$GIT_REF\`
54+
**Timestamp:** $(date -u +%Y-%m-%dT%H:%M:%SZ)
55+
EOF
56+
)
57+
gh issue comment "$ISSUE_NUMBER" \
58+
--repo "$ISSUE_REPO" \
59+
--body "$body"
60+
61+
- name: Create workflow failure issue
62+
if: steps.check-existing.outputs.existing_issue == ''
63+
shell: bash
64+
env:
65+
GH_TOKEN: ${{ inputs.token }}
66+
ISSUE_REPO: ${{ inputs.repo }}
67+
WORKFLOW_NAME: ${{ github.workflow }}
68+
SOURCE_REPO: ${{ github.repository }}
69+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
70+
EVENT_NAME: ${{ github.event_name }}
71+
GIT_REF: ${{ github.ref }}
72+
ACTOR: ${{ github.actor }}
73+
run: |
74+
body=$(cat <<EOF
75+
### Workflow failure
76+
77+
**Workflow:** \`$WORKFLOW_NAME\`
78+
**Repository:** \`$SOURCE_REPO\`
79+
**Run:** $RUN_URL
80+
**Event:** \`$EVENT_NAME\`
81+
**Ref:** \`$GIT_REF\`
82+
**Triggered by:** \`$ACTOR\`
83+
**Timestamp:** $(date -u +%Y-%m-%dT%H:%M:%SZ)
84+
85+
---
86+
This issue was automatically created by the create-workflow-failure-issue action to enable automated diagnosis.
87+
EOF
88+
)
89+
gh issue create \
90+
--repo "$ISSUE_REPO" \
91+
--label "workflow-failure" \
92+
--title "[Workflow Failure] $WORKFLOW_NAME" \
93+
--body "$body"

.github/actions/get-changed-files/action.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/actions/get-changed-files/get-changed-files.sh

Lines changed: 0 additions & 204 deletions
This file was deleted.

.github/actions/retry-command/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ runs:
1818
steps:
1919
- name: Retry command
2020
shell: bash
21+
env:
22+
INPUT_MAX_ATTEMPTS: ${{ inputs.max_attempts }}
23+
INPUT_DELAY: ${{ inputs.delay }}
24+
INPUT_COMMAND: ${{ inputs.command }}
2125
run: |
2226
# Generic retry function: configurable attempts and delay
2327
retry_command() {
24-
local max_attempts=${{ inputs.max_attempts }}
25-
local delay=${{ inputs.delay }}
28+
local max_attempts=${INPUT_MAX_ATTEMPTS}
29+
local delay=${INPUT_DELAY}
2630
local attempt=1
27-
local command="${{ inputs.command }}"
31+
local command="${INPUT_COMMAND}"
2832
2933
while [ $attempt -le $max_attempts ]; do
3034
echo "Attempt $attempt/$max_attempts: Running command..."

0 commit comments

Comments
 (0)