Skip to content

Add Claude Workflows#48594

Open
strawgate wants to merge 2 commits intoelastic:mainfrom
strawgate:add-claude-workflows
Open

Add Claude Workflows#48594
strawgate wants to merge 2 commits intoelastic:mainfrom
strawgate:add-claude-workflows

Conversation

@strawgate
Copy link
Contributor

@strawgate strawgate commented Jan 29, 2026

Add Claude workflows for @claude in issues, pull requests, and automated pull request reviews.

Restricted to: strawgate,AlexanderWert,perk,graphaelli,cmacknz,axw,theletterf,jlind23,nimarezainia,pierrehilbert,bturquet

@strawgate strawgate requested a review from a team as a code owner January 29, 2026 04:23
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 29, 2026
@botelastic
Copy link

botelastic bot commented Jan 29, 2026

This pull request doesn't have a Team:<team> label.

@github-actions
Copy link
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Jan 29, 2026

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @strawgate? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@strawgate strawgate changed the title Add Claude Workflows to repository Add Claude Workflows Jan 29, 2026
Copy link
Member

@v1v v1v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a fw comments:

  • update versions
  • git depth 0
  • checkout PR
  • configure tools for running Claude
  • github secret onboarding

One last thing, if it helps, we have all logs/traces for the GitHub actions running at Elastic in ECH. I wonder whether the Build Failure analysis could be performed outside this GitHub workflow and in an agnostic manner using Elastic, so that when we ingest logs for Buildkite builds, we can work in both scenarios.

- name: Check if all required workflows have completed
id: check-workflows
if: github.event.workflow_run.event == 'pull_request'
uses: actions/github-script@v7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/actions/github-script/releases/tag/v8

Suggested change
uses: actions/github-script@v7
uses: actions/github-script@v8

Comment on lines +84 to +108
- name: Checkout
if: steps.check-workflows.outputs.should_run != 'false'
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup Go
if: steps.check-workflows.outputs.should_run != 'false'
uses: actions/setup-go@v5
with:
go-version-file: .go-version

- name: Setup Python
if: steps.check-workflows.outputs.should_run != 'false'
uses: actions/setup-python@v6
with:
python-version-file: .python-version

- name: Install system dependencies
if: steps.check-workflows.outputs.should_run != 'false'
run: sudo apt-get update && sudo apt-get install -y libpcap-dev librpm-dev python3-venv

- name: Install Mage
if: steps.check-workflows.outputs.should_run != 'false'
run: make mage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason the build failure analyser requires the golang and python context?

Comment on lines +86 to +88
uses: actions/checkout@v6
with:
fetch-depth: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for checking out the whole git history?

if: steps.check-workflows.outputs.should_run != 'false'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
claude-oauth-token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a process to onboard GitHub secrets, so we track who created and how to rotated, this is not a blocker, we can work on this together


- name: Checkout
if: steps.check-workflows.outputs.should_run != 'false'
uses: actions/checkout@v6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will checkout the main branch always, is that expected? or checking out the PR that failed instead?

@@ -0,0 +1,46 @@
name: Claude Issue Triage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for installing the go/python tools for running the issue triage process?

Comment on lines +21 to +22
with:
fetch-depth: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for using depth 0?

GITHUB_TOKEN: ${{ github.token }}
run: gh pr checkout ${{ github.event.issue.number }}

- uses: actions/setup-go@v5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/setup-go@v5
- uses: actions/setup-go@v6

Comment on lines +27 to +28
with:
fetch-depth: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why depth 0?

contents: write
pull-requests: write
issues: write
id-token: write
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason for using id-token: write?

actions: read
issues: write
pull-requests: write
id-token: write
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason for this permission?

Comment on lines +7 to +12
permissions:
contents: read
actions: read
issues: write
pull-requests: write
id-token: write
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

We follow the least-permissive access:

  • top permissions (contents: read)
  • job permissions (the required ones)

This framework allows us to handle multiple jobs within the same workflow while enforcing the least-permissive access.

Copy link
Member

@v1v v1v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved as I don't see any blockers, just some minor and nit comments we can walk through together in a follow-up.

types: [created]

permissions:
contents: write
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason to enable contents: write permissions here?

There is one caveat when using GITHUB_TOKEN and push a commit, it will not trigger any GitHub workflows (to avoid recurrency), see https://docs.github.com/en/actions/concepts/security/github_token#when-github_token-triggers-workflow-runs

For example, if a workflow run pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur.

@strawgate
Copy link
Contributor Author

this is wip and the current version is in the integrations repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs_team Indicates that the issue/PR needs a Team:* label skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants