GitHub
Run Lunos on issues and pull requests from a GitHub Actions workflow, with your own token.
Lunos can work on GitHub issues and pull requests. Mention /lunos or /oc in a comment, and a GitHub Actions workflow runs Lunos on the repository and answers in the thread. If Lunos changes code, it opens a pull request, or pushes to the pull request it was asked about.
The workflow runs with a GitHub token you control. There is no Lunos GitHub App to install, and nothing is sent to a token-exchange service.
Set it up
Run this from the repository:
lunos github installIt asks for a model provider and a model, then writes .github/workflows/lunos.yml. Next:
- Commit the workflow file and push it.
- Add your model provider’s API key to the repository or organisation secrets, under the names the command printed (for example
MISTRAL_API_KEY). - Comment
/oc summarizeon an issue to try it.
The generated workflow looks like this:
name: lunos
on: issue_comment: types: [created] pull_request_review_comment: types: [created]
jobs: lunos: if: | contains(github.event.comment.body, ' /oc') || startsWith(github.event.comment.body, '/oc') || contains(github.event.comment.body, ' /lunos') || startsWith(github.event.comment.body, '/lunos') runs-on: ubuntu-latest permissions: contents: write pull-requests: write issues: write steps: - name: Checkout repository uses: actions/checkout@v6 with: persist-credentials: false
- name: Run Lunos uses: AxsionDev/Lunos/github@vX.Y.Z # your Lunos version env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} with: model: mistral/devstral-latest version: X.Y.Z use_github_token: trueThe action and the version it installs are pinned to the Lunos version that wrote the workflow. The action installs lunos-ai from npm and runs lunos github run. Lunos pushes with the token in GITHUB_TOKEN, so checkout doesn’t keep its own credentials.
The token
By default the workflow uses the repository’s own GITHUB_TOKEN, which GitHub creates for each run. The permissions block gives it what Lunos needs:
| Permission | Why |
|---|---|
contents: write | push commits and branches |
pull-requests: write | open pull requests and comment on them |
issues: write | comment on issues and add a reaction to the triggering comment |
Lunos then acts as github-actions[bot]. One GitHub limit applies: pushes and pull requests made with GITHUB_TOKEN don’t start other workflows, so your CI won’t run on a pull request Lunos opens.
To act as a different account, or to have CI run on Lunos’s pull requests, use a fine-grained personal access token instead:
- Create the token for this repository only, with Contents, Pull requests and Issues set to read and write.
- Store it as a repository secret, for example
LUNOS_GITHUB_TOKEN. - In the workflow, set
GITHUB_TOKEN: ${{ secrets.LUNOS_GITHUB_TOKEN }}.
Action inputs
| Input | Default | What it does |
|---|---|---|
model | (required) | provider/model to run |
version | latest | lunos-ai version to install |
agent | the config’s default agent | a primary agent to use |
prompt | the comment | replaces the prompt |
mentions | /lunos,/oc | comma-separated trigger phrases |
variant | none | provider-specific reasoning effort |
share | off | true shares the session; sharing must also be enabled in your Lunos config, with an organisation console or enterprise.url to share to. Without one the run logs why and carries on |
use_github_token | true | use the GITHUB_TOKEN env var |
oidc_base_url | none | only with use_github_token: false: a GitHub App token-exchange service you run |
A Lunos GitHub App, which would remove the token step, is planned with Lunos Cloud.