-
Notifications
You must be signed in to change notification settings - Fork 0
chore: update README.md #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,12 +2,87 @@ | |
|
|
||
| This GitHub action starts a [Coder Task](https://coder.com/docs/ai-coder/tasks) and optionally posts a comment on a GitHub issue. It's designed to be used as part of a wider workflow. | ||
|
|
||
| ## Features | ||
| ## Overview | ||
|
|
||
| - Starts a Coder Task using your specified template and preset | ||
| - Posts a single status comment on a GitHub issue | ||
| - Maps GitHub users to Coder users | ||
| - When creating a Coder task, you must specify the Github user ID as an input. | ||
| - The action then queries the Coder deployment to find the Coder user associated with the given Github user ID. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| - Note that this requires the Coder deployment to be configured with [GitHub OAuth](https://coder.com/docs/admin/external-auth#configure-a-github-oauth-app) and for the Coder user to have linked their GitHub account. | ||
| - If no corresponding Coder user is found, the action will fail. | ||
| - The action will then create a [Coder Task](https://coder.com/docs/ai-coder/tasks) for the user with the given template and prompt. | ||
| - Once the task has been created successfully, the action will post a comment on the GitHub issue with the task URL. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - A running Coder deployment (v2.28 or higher) accessible to the GitHub Actions runner. | ||
| - A [Tasks-capable](https://coder.com/docs/ai-coder/tasks#getting-started-with-tasks) Coder template | ||
| - A Coder session token with the required permissions to: | ||
| - Read all users in the given organization | ||
| - Create tasks for any user in the given organization | ||
|
|
||
| ## Example Usage | ||
|
|
||
| TODO | ||
| The below example will start a Coder task when the `coder` label is applied to an issue. | ||
|
|
||
| ```yaml | ||
| name: Start Coder Task | ||
|
|
||
| on: | ||
| issues: | ||
| types: | ||
| - labeled | ||
|
|
||
| permissions: | ||
| issues: write | ||
|
|
||
| jobs: | ||
| start-coder-task: | ||
| runs-on: ubuntu-latest | ||
| if: github.event.label.name == 'coder' | ||
| steps: | ||
| - name: Start Coder Task | ||
| uses: coder/start-coder-task@v0.0.2 | ||
| with: | ||
| coder-url: ${{ secrets.CODER_URL }} | ||
| coder-token: ${{ secrets.CODER_TOKEN }} | ||
| coder-organization: "default" | ||
| coder-template-name: "my-template" | ||
| coder-task-name-prefix: "gh-task" | ||
| coder-task-prompt: "Use the gh CLI to read ${{ github.event.issue.html_url }}, write an appropriate plan for solving the issue to PLAN.md, and then wait for feedback." | ||
| github-user-id: ${{ github.event.sender.id }} | ||
| github-issue-url: ${{ github.event.issue.html_url }} | ||
| github-token: ${{ github.token }} | ||
| comment-on-issue: true | ||
| ``` | ||
|
|
||
| ## Inputs | ||
|
|
||
| <!-- | ||
| yq -r '.inputs | to_entries[] | "| \(.key) | \(.value.description) | \(.value.required // false ) | \(.value.default // \"-\") |"' action.yaml | ||
| --> | ||
|
|
||
| | Name | Description | Required | Default | | ||
| | ---------------------- | --------------------------------------- | -------- | --------- | | ||
| | coder-task-prompt | Prompt/instructions to send to the task | true | - | | ||
| | coder-token | Coder session token for authentication | true | - | | ||
| | coder-url | Coder deployment URL | true | - | | ||
| | coder-template-name | Coder template to use for workspace | true | - | | ||
| | github-issue-url | GitHub issue URL to link this task to | true | - | | ||
| | github-token | GitHub token for API operations | true | - | | ||
| | github-user-id | GitHub user ID to create task for | true | - | | ||
| | coder-organization | Coder organization name | false | "default" | | ||
| | coder-task-name-prefix | Prefix for task name | false | "gh" | | ||
| | coder-template-preset | Template preset to use (optional) | false | - | | ||
| | comment-on-issue | Whether to comment on the GitHub issue | false | true | | ||
|
|
||
| ## Outputs | ||
|
|
||
| <!-- | ||
| yq -r '.outputs | to_entries[] | "| \(.key) | \(.value.description) |"' action.yaml | ||
| --> | ||
|
|
||
| | Name | Description | | ||
| | -------------- | -------------------------------------------------------------------- | | ||
| | coder-username | The Coder username resolved from GitHub user | | ||
| | task-name | The task name | | ||
| | task-url | The URL to view the task in Coder | | ||
| | task-created | Whether the task was newly created (true) or already existed (false) | | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We store the GitHub user ID in the users table and lookup based on that, not the username.