Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ci: assign tasks to triggering username in ai triage workflow#20022

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

Merged
johnstcn merged 5 commits intomainfromcj/traiage-create-owner
Sep 30, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions.github/workflows/traiage.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -73,10 +73,27 @@ jobs:
coder whoami
echo "$HOME/.local/bin" >> "${GITHUB_PATH}"

- name: Get Coder username from GitHub actor
id: get-coder-username
env:
CODER_SESSION_TOKEN: ${{ secrets.TRAIAGE_CODER_SESSION_TOKEN }}
GITHUB_USER_ID: ${{
(github.event_name == 'workflow_dispatch' && github.actor_id)
}}
run: |
[[ -z "${GITHUB_USER_ID}" || "${GITHUB_USER_ID}" == "null" ]] && echo "No GitHub actor ID found" && exit 1
user_json=$(
coder users list --github-user-id="${GITHUB_USER_ID}" --output=json
)
coder_username=$(jq -r 'first | .username' <<< "$user_json")
[[ -z "${coder_username}" || "${coder_username}" == "null" ]] && echo "No Coder user with GitHub user ID ${GITHUB_USER_ID} found" && exit 1
echo "coder_username=${coder_username}" >> "${GITHUB_OUTPUT}"

# TODO(Cian): this is a good use-case for 'recipes'
- name: Create Coder task
id: create-task
env:
CODER_USERNAME: ${{ steps.get-coder-username.outputs.coder_username }}
CONTEXT_KEY: ${{ steps.extract-context.outputs.context_key }}
GITHUB_TOKEN: ${{ github.token }}
ISSUE_URL: ${{ inputs.issue_url }}
Expand All@@ -103,9 +120,9 @@ jobs:
export TASK_NAME="${PREFIX}-${CONTEXT_KEY}-${RUN_ID}"
echo "Creating task: $TASK_NAME"
./scripts/traiage.sh create
coder exp task status "$TASK_NAME" --watch
echo "TASK_NAME=${TASK_NAME}" >> "${GITHUB_OUTPUT}"
echo "TASK_NAME=${TASK_NAME}" >> "${GITHUB_ENV}"
coder exp task status "${CODER_USERNAME}/$TASK_NAME" --watch
echo "TASK_NAME=${CODER_USERNAME}/${TASK_NAME}" >> "${GITHUB_OUTPUT}"
echo "TASK_NAME=${CODER_USERNAME}/${TASK_NAME}" >> "${GITHUB_ENV}"

- name: Create and upload archive
id: create-archive
Expand Down
7 changes: 4 additions & 3 deletionsscripts/traiage.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,18 +19,18 @@ usage() {
}

create() {
requiredenvs CODER_URL CODER_SESSION_TOKEN TASK_NAME TEMPLATE_NAME TEMPLATE_PRESET PROMPT
requiredenvs CODER_URL CODER_SESSION_TOKENCODER_USERNAMETASK_NAME TEMPLATE_NAME TEMPLATE_PRESET PROMPT
# Check if a task already exists
set +e
task_json=$("${CODER_BIN}" \
--url "${CODER_URL}" \
--token "${CODER_SESSION_TOKEN}" \
exp tasks status "${TASK_NAME}" \
exp tasks status "${CODER_USERNAME}/${TASK_NAME}" \
--output json)
set -e

if [[ "${TASK_NAME}" == $(jq -r '.name' <<<"${task_json}") ]]; then
echo "Task \"${TASK_NAME}\" already exists. Sending prompt to existing task."
echo "Task \"${CODER_USERNAME}/${TASK_NAME}\" already exists. Sending prompt to existing task."
prompt
exit 0
fi
Expand All@@ -43,6 +43,7 @@ create() {
--template "${TEMPLATE_NAME}" \
--preset "${TEMPLATE_PRESET}" \
--org coder \
--owner "${CODER_USERNAME}" \
--stdin <<<"${PROMPT}"
exit 0
}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp