- Notifications
You must be signed in to change notification settings - Fork1k
ci: add auto-generated summary and GitHub issue comment workflows to triage.yaml#19925
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Changes fromall commits
1b4ea3b
8029f75
eb1c657
6f4325e
98c6380
8505158
35417de
1638d3f
4e03814
247a646
0604745
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -20,6 +20,18 @@ usage() { | ||||||||
create() { | ||||||||
requiredenvs CODER_URL CODER_SESSION_TOKEN WORKSPACE_NAME TEMPLATE_NAME TEMPLATE_PARAMETERS | ||||||||
# Check if a workspace already exists | ||||||||
exists=$("${CODER_BIN}" \ | ||||||||
--url "${CODER_URL}" \ | ||||||||
--token "${CODER_SESSION_TOKEN}" \ | ||||||||
list \ | ||||||||
--search "owner:me" \ | ||||||||
--output json | | ||||||||
jq -r --arg name "${WORKSPACE_NAME}" 'any(.[]; select(.name == $name))') | ||||||||
if [[ "${exists}" == "true" ]]; then | ||||||||
echo "Workspace ${WORKSPACE_NAME} already exists." | ||||||||
exit 0 | ||||||||
fi | ||||||||
"${CODER_BIN}" \ | ||||||||
--url "${CODER_URL}" \ | ||||||||
--token "${CODER_SESSION_TOKEN}" \ | ||||||||
@@ -54,7 +66,8 @@ ssh_config() { | ||||||||
--url "${CODER_URL}" \ | ||||||||
--token "${CODER_SESSION_TOKEN}" \ | ||||||||
--ssh-config-file="${OPENSSH_CONFIG_FILE}" \ | ||||||||
--yes \ | ||||||||
>/dev/null 2>&1 | ||||||||
export OPENSSH_CONFIG_FILE | ||||||||
} | ||||||||
@@ -169,6 +182,34 @@ archive() { | ||||||||
exit 0 | ||||||||
} | ||||||||
summary() { | ||||||||
requiredenvs CODER_URL CODER_SESSION_TOKEN WORKSPACE_NAME | ||||||||
ssh_config | ||||||||
# We want the heredoc to be expanded locally and not remotely. | ||||||||
# shellcheck disable=SC2087 | ||||||||
ssh \ | ||||||||
-F "${OPENSSH_CONFIG_FILE}" \ | ||||||||
"${WORKSPACE_NAME}.coder" \ | ||||||||
-- \ | ||||||||
bash <<-EOF | ||||||||
#!/usr/bin/env bash | ||||||||
set -eu | ||||||||
summary=\$(echo -n 'You are a CLI utility that generates a human-readable Markdown summary for the currently staged AND unstaged changes. Print ONLY the summary and nothing else.' | \${HOME}/.local/bin/claude --print) | ||||||||
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. [nitpick] The command line for generating the summary is excessively long and hard to read. Consider breaking this into multiple lines or storing the prompt in a variable for better readability and maintainability. Suggested change
Copilot uses AI. Check for mistakes. | ||||||||
if [[ -z "\${summary}" ]]; then | ||||||||
echo "Generating a summary failed." | ||||||||
echo "Here is a short overview of the changes:" | ||||||||
echo | ||||||||
echo "" | ||||||||
echo "\$(git diff --stat)" | ||||||||
echo "" | ||||||||
exit 0 | ||||||||
fi | ||||||||
echo "\${summary}" | ||||||||
exit 0 | ||||||||
EOF | ||||||||
} | ||||||||
commit_push() { | ||||||||
requiredenvs CODER_URL CODER_SESSION_TOKEN WORKSPACE_NAME | ||||||||
ssh_config | ||||||||
@@ -265,6 +306,9 @@ main() { | ||||||||
resume) | ||||||||
resume | ||||||||
;; | ||||||||
summary) | ||||||||
summary | ||||||||
;; | ||||||||
*) | ||||||||
echo "Unknown option: $1" | ||||||||
usage | ||||||||
Uh oh!
There was an error while loading.Please reload this page.