File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 66
77permissions :
88 contents : read
9+ issues : write
910
1011jobs :
1112 ambient :
1516 runs-on : ubuntu-latest
1617 steps :
1718 - uses : ambient-code/ambient-action@v0.0.2
19+ id : session
1820 with :
1921 api-url : ${{ secrets.AMBIENT_API_URL }}
2022 api-token : ${{ secrets.AMBIENT_BOT_TOKEN }}
2325 display-name : " Issue #${{ github.event.issue.number }}"
2426 repos : ' [{"url": "https://github.com/${{ github.repository }}", "branch": "ambient/issue-${{ github.event.issue.number }}", "autoPush": true}]'
2527 labels : ' {"source": "github-issue", "issue": "${{ github.event.issue.number }}"}'
28+ wait : ' true'
29+ timeout : ' 300'
30+
31+ - name : Post result to issue
32+ if : always()
33+ env :
34+ GH_TOKEN : ${{ github.token }}
35+ SESSION_NAME : ${{ steps.session.outputs.session-name }}
36+ SESSION_PHASE : ${{ steps.session.outputs.session-phase }}
37+ SESSION_RESULT : ${{ steps.session.outputs.session-result }}
38+ run : |
39+ if [ "$SESSION_PHASE" = "Completed" ]; then
40+ EMOJI="✅"
41+ elif [ -z "$SESSION_PHASE" ]; then
42+ EMOJI="❌"
43+ SESSION_PHASE="CreateFailed"
44+ else
45+ EMOJI="⚠️"
46+ fi
47+
48+ {
49+ printf '%s\n' "${EMOJI} **Ambient session ${SESSION_PHASE}** (\`${SESSION_NAME}\`)"
50+ if [ -n "$SESSION_RESULT" ]; then
51+ printf '\n<details>\n<summary>Session output</summary>\n\n'
52+ printf '%s\n' "$SESSION_RESULT"
53+ printf '\n</details>\n'
54+ fi
55+ } > "$RUNNER_TEMP/comment-body.md"
56+
57+ gh issue comment "${{ github.event.issue.number }}" \
58+ --repo "${{ github.repository }}" \
59+ --body-file "$RUNNER_TEMP/comment-body.md"
You can’t perform that action at this time.
0 commit comments