@codyswann/lisa 1.52.2 → 1.52.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/config.d.ts +2 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +5 -0
- package/dist/core/lisa.js.map +1 -1
- package/expo/create-only/.github/workflows/ci.yml +2 -2
- package/expo/create-only/.github/workflows/deploy.yml +1 -1
- package/expo/deletions.json +8 -0
- package/nestjs/create-only/.github/workflows/ci.yml +1 -1
- package/nestjs/create-only/.github/workflows/deploy.yml +1 -1
- package/nestjs/deletions.json +7 -1
- package/package.json +1 -1
- package/typescript/copy-overwrite/.github/workflows/auto-update-pr-branches.yml +9 -30
- package/typescript/copy-overwrite/.github/workflows/claude-ci-auto-fix.yml +6 -131
- package/typescript/copy-overwrite/.github/workflows/claude-code-review-response.yml +9 -101
- package/typescript/copy-overwrite/.github/workflows/claude-deploy-auto-fix.yml +6 -129
- package/typescript/copy-overwrite/.github/workflows/claude-nightly-code-complexity.yml +2 -118
- package/typescript/copy-overwrite/.github/workflows/claude-nightly-test-coverage.yml +2 -115
- package/typescript/copy-overwrite/.github/workflows/claude-nightly-test-improvement.yml +4 -108
- package/typescript/copy-overwrite/.github/workflows/claude.yml +8 -38
- package/typescript/copy-overwrite/.github/workflows/reusable-auto-update-pr-branches.yml +63 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-ci-auto-fix.yml +167 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-code-review-response.yml +139 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-deploy-auto-fix.yml +165 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-nightly-code-complexity.yml +131 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-nightly-test-coverage.yml +128 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-nightly-test-improvement.yml +127 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude.yml +67 -0
- package/typescript/deletions.json +12 -0
- package/expo/copy-overwrite/.github/workflows/build.yml +0 -75
- package/expo/copy-overwrite/.github/workflows/lighthouse.yml +0 -88
- package/expo/copy-overwrite/.github/workflows/zap-baseline.yml +0 -107
- package/nestjs/copy-overwrite/.github/workflows/load-test.yml +0 -285
- package/nestjs/copy-overwrite/.github/workflows/zap-baseline.yml +0 -123
- package/typescript/copy-overwrite/.github/workflows/create-github-issue-on-failure.yml +0 -115
- package/typescript/copy-overwrite/.github/workflows/create-issue-on-failure.yml +0 -176
- package/typescript/copy-overwrite/.github/workflows/create-jira-issue-on-failure.yml +0 -197
- package/typescript/copy-overwrite/.github/workflows/create-sentry-issue-on-failure.yml +0 -269
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
# This file is managed by Lisa.
|
|
2
|
-
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
-
# -----------------------------------------------------------------------------
|
|
4
|
-
# Jira Issue Creation Workflow
|
|
5
|
-
# -----------------------------------------------------------------------------
|
|
6
|
-
# ⚠️ WARNING: THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY! ⚠️
|
|
7
|
-
# Any changes may be overwritten by the generation process.
|
|
8
|
-
# This workflow creates a Jira issue when another workflow fails.
|
|
9
|
-
# It captures details about the failure and creates a standardized issue
|
|
10
|
-
# to help track and resolve CI/CD problems in Jira.
|
|
11
|
-
#
|
|
12
|
-
# Example usage in another workflow:
|
|
13
|
-
# ```yaml
|
|
14
|
-
# create_jira_issue_on_failure:
|
|
15
|
-
# if: failure()
|
|
16
|
-
# uses: ./.github/workflows/jira-issue-on-failure.yml
|
|
17
|
-
# with:
|
|
18
|
-
# workflow_name: 'My Workflow'
|
|
19
|
-
# failed_job: 'build_and_test'
|
|
20
|
-
# JIRA_BASE_URL: ${{ vars.JIRA_BASE_URL }}
|
|
21
|
-
# JIRA_USER_EMAIL: ${{ vars.JIRA_USER_EMAIL }}
|
|
22
|
-
# JIRA_PROJECT_KEY: ${{ vars.JIRA_PROJECT_KEY }}
|
|
23
|
-
# secrets:
|
|
24
|
-
# JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
|
|
25
|
-
# ```
|
|
26
|
-
|
|
27
|
-
name: 🔖 Jira Issue on Workflow Failure
|
|
28
|
-
|
|
29
|
-
on:
|
|
30
|
-
workflow_call:
|
|
31
|
-
inputs:
|
|
32
|
-
workflow_name:
|
|
33
|
-
required: true
|
|
34
|
-
type: string
|
|
35
|
-
description: 'Name of the workflow that failed'
|
|
36
|
-
failed_job:
|
|
37
|
-
required: false
|
|
38
|
-
type: string
|
|
39
|
-
description: 'Name of the job that failed (optional)'
|
|
40
|
-
issue_type:
|
|
41
|
-
required: false
|
|
42
|
-
type: string
|
|
43
|
-
default: 'Bug'
|
|
44
|
-
description: 'Type of Jira issue to create (Bug, Task, etc.)'
|
|
45
|
-
JIRA_BASE_URL:
|
|
46
|
-
required: true
|
|
47
|
-
type: string
|
|
48
|
-
description: 'Jira instance base URL (e.g., https://your-domain.atlassian.net)'
|
|
49
|
-
JIRA_USER_EMAIL:
|
|
50
|
-
required: true
|
|
51
|
-
type: string
|
|
52
|
-
description: 'Email address of the Jira user associated with the API token'
|
|
53
|
-
JIRA_PROJECT_KEY:
|
|
54
|
-
required: true
|
|
55
|
-
type: string
|
|
56
|
-
description: 'The key of the Jira project where issues should be created'
|
|
57
|
-
node_version:
|
|
58
|
-
description: 'Node.js version to use'
|
|
59
|
-
required: false
|
|
60
|
-
default: '22.21.1'
|
|
61
|
-
type: string
|
|
62
|
-
package_manager:
|
|
63
|
-
description: 'Package manager to use (npm, yarn, or bun)'
|
|
64
|
-
required: false
|
|
65
|
-
default: 'npm'
|
|
66
|
-
type: string
|
|
67
|
-
working_directory:
|
|
68
|
-
description: 'Directory to run commands in (if not root)'
|
|
69
|
-
required: false
|
|
70
|
-
default: ''
|
|
71
|
-
type: string
|
|
72
|
-
secrets:
|
|
73
|
-
JIRA_API_TOKEN:
|
|
74
|
-
required: true
|
|
75
|
-
description: 'Jira API token for authentication'
|
|
76
|
-
|
|
77
|
-
# Concurrency is managed by the parent workflow that calls this one
|
|
78
|
-
# This avoids deadlocks between parent and child workflows
|
|
79
|
-
|
|
80
|
-
jobs:
|
|
81
|
-
create_jira_issue:
|
|
82
|
-
name: 📝 Create Jira Issue
|
|
83
|
-
runs-on: ubuntu-latest
|
|
84
|
-
timeout-minutes: 5
|
|
85
|
-
steps:
|
|
86
|
-
- name: 📥 Checkout repository
|
|
87
|
-
uses: actions/checkout@v4
|
|
88
|
-
|
|
89
|
-
- name: 🔧 Setup Node.js
|
|
90
|
-
uses: actions/setup-node@v4
|
|
91
|
-
with:
|
|
92
|
-
node-version: ${{ inputs.node_version }}
|
|
93
|
-
cache: ${{ inputs.package_manager != 'bun' && inputs.package_manager || '' }}
|
|
94
|
-
|
|
95
|
-
- name: 🔖 Create Jira Issue
|
|
96
|
-
id: create_jira_issue
|
|
97
|
-
run: |
|
|
98
|
-
cd "${{ inputs.working_directory || '.' }}"
|
|
99
|
-
|
|
100
|
-
# Set variables
|
|
101
|
-
WORKFLOW_NAME="${{ inputs.workflow_name }}"
|
|
102
|
-
FAILED_JOB="${{ inputs.failed_job || 'Unknown' }}"
|
|
103
|
-
ISSUE_TYPE="${{ inputs.issue_type }}"
|
|
104
|
-
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
105
|
-
|
|
106
|
-
# Get commit message, handling special characters properly
|
|
107
|
-
# Remove leading/trailing whitespace and escape for shell
|
|
108
|
-
COMMIT_MESSAGE="${{ github.event.head_commit.message || 'N/A' }}"
|
|
109
|
-
|
|
110
|
-
# Create summary with failure details
|
|
111
|
-
if [ "$FAILED_JOB" != "Unknown" ]; then
|
|
112
|
-
SUMMARY="🚨 CI Failure: ${WORKFLOW_NAME} - ${FAILED_JOB}"
|
|
113
|
-
else
|
|
114
|
-
SUMMARY="🚨 CI Failure: ${WORKFLOW_NAME}"
|
|
115
|
-
fi
|
|
116
|
-
|
|
117
|
-
# Create Jira description with properly escaped values
|
|
118
|
-
FAILED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
119
|
-
|
|
120
|
-
# Create JSON payload for Jira API using jq for proper escaping
|
|
121
|
-
# All dynamic content is passed as jq arguments to ensure proper escaping
|
|
122
|
-
PAYLOAD=$(jq -n \
|
|
123
|
-
--arg key "${{ inputs.JIRA_PROJECT_KEY }}" \
|
|
124
|
-
--arg summary "${SUMMARY}" \
|
|
125
|
-
--arg workflow_name "${WORKFLOW_NAME}" \
|
|
126
|
-
--arg failed_job "${FAILED_JOB}" \
|
|
127
|
-
--arg run_url "${RUN_URL}" \
|
|
128
|
-
--arg repository "${{ github.repository }}" \
|
|
129
|
-
--arg commit "${{ github.sha }}" \
|
|
130
|
-
--arg commit_message "${COMMIT_MESSAGE}" \
|
|
131
|
-
--arg triggered_by "${{ github.actor }}" \
|
|
132
|
-
--arg failed_at "${FAILED_AT}" \
|
|
133
|
-
--arg issuetype "${ISSUE_TYPE}" \
|
|
134
|
-
'{
|
|
135
|
-
"fields": {
|
|
136
|
-
"project": {
|
|
137
|
-
"key": $key
|
|
138
|
-
},
|
|
139
|
-
"summary": $summary,
|
|
140
|
-
"description": ("h2. Workflow Failure\n\nThe \"" + $workflow_name + "\" workflow has failed" + (if $failed_job != "Unknown" then " in job: *" + $failed_job + "*" else "" end) + ".\n\nh3. Details\n* *Workflow Run*: [View Run Details|" + $run_url + "]\n* *Repository*: " + $repository + "\n* *Commit*: " + $commit + "\n* *Commit Message*: " + $commit_message + "\n* *Triggered by*: " + $triggered_by + "\n* *Failed at*: " + $failed_at + "\n\nPlease investigate the workflow logs for more details on the failure."),
|
|
141
|
-
"issuetype": {
|
|
142
|
-
"name": $issuetype
|
|
143
|
-
},
|
|
144
|
-
"labels": ["ci-failure", "automated"]
|
|
145
|
-
}
|
|
146
|
-
}')
|
|
147
|
-
|
|
148
|
-
# Debug: Print the payload to see what's being sent
|
|
149
|
-
echo "Debug: Generated payload:"
|
|
150
|
-
echo "$PAYLOAD" | jq .
|
|
151
|
-
|
|
152
|
-
# Call Jira API to create issue
|
|
153
|
-
RESPONSE=$(curl -s -D- \
|
|
154
|
-
-u "${{ inputs.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }}" \
|
|
155
|
-
-X POST \
|
|
156
|
-
-H "Content-Type: application/json" \
|
|
157
|
-
--data "${PAYLOAD}" \
|
|
158
|
-
"${{ inputs.JIRA_BASE_URL }}/rest/api/2/issue")
|
|
159
|
-
|
|
160
|
-
# Extract issue key from response
|
|
161
|
-
ISSUE_KEY=$(echo "$RESPONSE" | grep -o 'key":"[^"]*' | cut -d'"' -f3)
|
|
162
|
-
|
|
163
|
-
if [ -n "$ISSUE_KEY" ]; then
|
|
164
|
-
echo "Successfully created Jira issue: $ISSUE_KEY"
|
|
165
|
-
echo "issue_key=$ISSUE_KEY" >> $GITHUB_OUTPUT
|
|
166
|
-
echo "issue_url=${{ inputs.JIRA_BASE_URL }}/browse/$ISSUE_KEY" >> $GITHUB_OUTPUT
|
|
167
|
-
else
|
|
168
|
-
echo "Failed to create Jira issue. API response:"
|
|
169
|
-
echo "$RESPONSE"
|
|
170
|
-
|
|
171
|
-
# Extract HTTP status code for better error diagnosis
|
|
172
|
-
HTTP_STATUS=$(echo "$RESPONSE" | grep -oE "^HTTP/[0-9.]+ [0-9]+" | awk '{print $2}')
|
|
173
|
-
if [ -n "$HTTP_STATUS" ]; then
|
|
174
|
-
echo "HTTP Status Code: $HTTP_STATUS"
|
|
175
|
-
|
|
176
|
-
if [ "$HTTP_STATUS" = "404" ]; then
|
|
177
|
-
echo "Error: API endpoint not found. Please check JIRA_BASE_URL configuration."
|
|
178
|
-
elif [ "$HTTP_STATUS" = "401" ]; then
|
|
179
|
-
echo "Error: Authentication failed. Please check JIRA_USER_EMAIL and JIRA_API_TOKEN."
|
|
180
|
-
elif [ "$HTTP_STATUS" = "403" ]; then
|
|
181
|
-
echo "Error: Permission denied. Please check user permissions."
|
|
182
|
-
fi
|
|
183
|
-
fi
|
|
184
|
-
|
|
185
|
-
# Print payload for debugging (with sensitive data redacted)
|
|
186
|
-
echo "Request payload (redacted):"
|
|
187
|
-
echo "$PAYLOAD" | sed 's/"key":"[^"]*"/"key":"***"/g'
|
|
188
|
-
|
|
189
|
-
exit 1
|
|
190
|
-
fi
|
|
191
|
-
|
|
192
|
-
- name: 📢 Report Issue Creation
|
|
193
|
-
if: steps.create_jira_issue.outputs.issue_key
|
|
194
|
-
run: |
|
|
195
|
-
cd "${{ inputs.working_directory || '.' }}"
|
|
196
|
-
echo "Created Jira issue: ${{ steps.create_jira_issue.outputs.issue_key }}"
|
|
197
|
-
echo "Issue URL: ${{ steps.create_jira_issue.outputs.issue_url }}"
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
# This file is managed by Lisa.
|
|
2
|
-
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
-
# -----------------------------------------------------------------------------
|
|
4
|
-
# Sentry Issue Creation Workflow
|
|
5
|
-
# -----------------------------------------------------------------------------
|
|
6
|
-
# ⚠️ WARNING: THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY! ⚠️
|
|
7
|
-
# Any changes may be overwritten by the generation process.
|
|
8
|
-
# This workflow creates a Sentry issue when another workflow fails.
|
|
9
|
-
# It captures details about the failure and creates a standardized issue
|
|
10
|
-
# to help track and resolve CI/CD problems in Sentry.
|
|
11
|
-
#
|
|
12
|
-
# Example usage in another workflow:
|
|
13
|
-
# ```yaml
|
|
14
|
-
# create_sentry_issue_on_failure:
|
|
15
|
-
# if: failure()
|
|
16
|
-
# uses: ./.github/workflows/create-sentry-issue-on-failure.yml
|
|
17
|
-
# with:
|
|
18
|
-
# workflow_name: 'My Workflow'
|
|
19
|
-
# failed_job: 'build_and_test'
|
|
20
|
-
# SENTRY_ORG: ${{ vars.SENTRY_ORG }}
|
|
21
|
-
# SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
|
|
22
|
-
# secrets:
|
|
23
|
-
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
24
|
-
# ```
|
|
25
|
-
|
|
26
|
-
name: 🔴 Sentry Issue on Workflow Failure
|
|
27
|
-
|
|
28
|
-
on:
|
|
29
|
-
workflow_call:
|
|
30
|
-
inputs:
|
|
31
|
-
workflow_name:
|
|
32
|
-
required: true
|
|
33
|
-
type: string
|
|
34
|
-
description: 'Name of the workflow that failed'
|
|
35
|
-
failed_job:
|
|
36
|
-
required: false
|
|
37
|
-
type: string
|
|
38
|
-
description: 'Name of the job that failed (optional)'
|
|
39
|
-
SENTRY_ORG:
|
|
40
|
-
required: true
|
|
41
|
-
type: string
|
|
42
|
-
description: 'Sentry organization slug (e.g., your-company)'
|
|
43
|
-
SENTRY_PROJECT:
|
|
44
|
-
required: true
|
|
45
|
-
type: string
|
|
46
|
-
description: 'Sentry project slug (e.g., serverless-knowledge-platform)'
|
|
47
|
-
environment:
|
|
48
|
-
required: false
|
|
49
|
-
type: string
|
|
50
|
-
default: 'production'
|
|
51
|
-
description: 'Environment where the failure occurred'
|
|
52
|
-
level:
|
|
53
|
-
required: false
|
|
54
|
-
type: string
|
|
55
|
-
default: 'error'
|
|
56
|
-
description: 'Sentry issue level (debug, info, warning, error, fatal)'
|
|
57
|
-
node_version:
|
|
58
|
-
description: 'Node.js version to use'
|
|
59
|
-
required: false
|
|
60
|
-
default: '22.21.1'
|
|
61
|
-
type: string
|
|
62
|
-
package_manager:
|
|
63
|
-
description: 'Package manager to use (npm, yarn, or bun)'
|
|
64
|
-
required: false
|
|
65
|
-
default: 'npm'
|
|
66
|
-
type: string
|
|
67
|
-
working_directory:
|
|
68
|
-
description: 'Directory to run commands in (if not root)'
|
|
69
|
-
required: false
|
|
70
|
-
default: ''
|
|
71
|
-
type: string
|
|
72
|
-
secrets:
|
|
73
|
-
SENTRY_AUTH_TOKEN:
|
|
74
|
-
required: true
|
|
75
|
-
description: 'Sentry Auth Token with project:write scope'
|
|
76
|
-
|
|
77
|
-
# Concurrency is managed by the parent workflow that calls this one
|
|
78
|
-
# This avoids deadlocks between parent and child workflows
|
|
79
|
-
|
|
80
|
-
jobs:
|
|
81
|
-
create_sentry_issue:
|
|
82
|
-
name: 📝 Create Sentry Issue
|
|
83
|
-
runs-on: ubuntu-latest
|
|
84
|
-
timeout-minutes: 5
|
|
85
|
-
steps:
|
|
86
|
-
- name: 📥 Checkout repository
|
|
87
|
-
uses: actions/checkout@v4
|
|
88
|
-
|
|
89
|
-
- name: 🔧 Setup Node.js
|
|
90
|
-
uses: actions/setup-node@v4
|
|
91
|
-
with:
|
|
92
|
-
node-version: ${{ inputs.node_version }}
|
|
93
|
-
cache: ${{ inputs.package_manager != 'bun' && inputs.package_manager || '' }}
|
|
94
|
-
|
|
95
|
-
- name: 🔴 Create Sentry Issue
|
|
96
|
-
id: create_sentry_issue
|
|
97
|
-
run: |
|
|
98
|
-
cd "${{ inputs.working_directory || '.' }}"
|
|
99
|
-
|
|
100
|
-
# Set variables
|
|
101
|
-
WORKFLOW_NAME="${{ inputs.workflow_name }}"
|
|
102
|
-
FAILED_JOB="${{ inputs.failed_job || 'Unknown' }}"
|
|
103
|
-
ENVIRONMENT="${{ inputs.environment }}"
|
|
104
|
-
LEVEL="${{ inputs.level }}"
|
|
105
|
-
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
106
|
-
|
|
107
|
-
# Get commit message, handling special characters properly
|
|
108
|
-
COMMIT_MESSAGE="${{ github.event.head_commit.message || 'N/A' }}"
|
|
109
|
-
|
|
110
|
-
# Create error message
|
|
111
|
-
if [ "$FAILED_JOB" != "Unknown" ]; then
|
|
112
|
-
ERROR_MESSAGE="CI/CD Workflow Failure: ${WORKFLOW_NAME} - ${FAILED_JOB}"
|
|
113
|
-
else
|
|
114
|
-
ERROR_MESSAGE="CI/CD Workflow Failure: ${WORKFLOW_NAME}"
|
|
115
|
-
fi
|
|
116
|
-
|
|
117
|
-
# Get current timestamp in ISO format
|
|
118
|
-
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")
|
|
119
|
-
|
|
120
|
-
# Create JSON payload for Sentry API using jq for proper escaping
|
|
121
|
-
PAYLOAD=$(jq -n \
|
|
122
|
-
--arg message "${ERROR_MESSAGE}" \
|
|
123
|
-
--arg level "${LEVEL}" \
|
|
124
|
-
--arg timestamp "${TIMESTAMP}" \
|
|
125
|
-
--arg workflow_name "${WORKFLOW_NAME}" \
|
|
126
|
-
--arg failed_job "${FAILED_JOB}" \
|
|
127
|
-
--arg run_url "${RUN_URL}" \
|
|
128
|
-
--arg repository "${{ github.repository }}" \
|
|
129
|
-
--arg commit "${{ github.sha }}" \
|
|
130
|
-
--arg commit_message "${COMMIT_MESSAGE}" \
|
|
131
|
-
--arg triggered_by "${{ github.actor }}" \
|
|
132
|
-
--arg environment "${ENVIRONMENT}" \
|
|
133
|
-
--arg ref "${{ github.ref }}" \
|
|
134
|
-
--arg run_id "${{ github.run_id }}" \
|
|
135
|
-
'{
|
|
136
|
-
"message": $message,
|
|
137
|
-
"level": $level,
|
|
138
|
-
"timestamp": $timestamp,
|
|
139
|
-
"platform": "other",
|
|
140
|
-
"sdk": {
|
|
141
|
-
"name": "github-actions",
|
|
142
|
-
"version": "1.0.0"
|
|
143
|
-
},
|
|
144
|
-
"logger": "github-actions.ci",
|
|
145
|
-
"environment": $environment,
|
|
146
|
-
"tags": {
|
|
147
|
-
"workflow": $workflow_name,
|
|
148
|
-
"job": $failed_job,
|
|
149
|
-
"repository": $repository,
|
|
150
|
-
"triggered_by": $triggered_by,
|
|
151
|
-
"ref": $ref,
|
|
152
|
-
"source": "github-actions"
|
|
153
|
-
},
|
|
154
|
-
"extra": {
|
|
155
|
-
"workflow_run_url": $run_url,
|
|
156
|
-
"commit_sha": $commit,
|
|
157
|
-
"commit_message": $commit_message,
|
|
158
|
-
"run_id": $run_id,
|
|
159
|
-
"failure_type": "ci_cd_workflow"
|
|
160
|
-
},
|
|
161
|
-
"contexts": {
|
|
162
|
-
"runtime": {
|
|
163
|
-
"name": "github-actions",
|
|
164
|
-
"version": "latest"
|
|
165
|
-
},
|
|
166
|
-
"os": {
|
|
167
|
-
"name": "ubuntu-latest"
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
"fingerprint": ["github-actions", $workflow_name, $failed_job]
|
|
171
|
-
}')
|
|
172
|
-
|
|
173
|
-
# Debug: Print the payload to see what'\''s being sent (without sensitive data)
|
|
174
|
-
echo "Debug: Generated payload:"
|
|
175
|
-
echo "$PAYLOAD" | jq 'del(.extra.commit_message)' | head -20
|
|
176
|
-
|
|
177
|
-
# Debug: Print Sentry configuration
|
|
178
|
-
echo "Debug: SENTRY_ORG=${{ inputs.SENTRY_ORG }}"
|
|
179
|
-
echo "Debug: SENTRY_PROJECT=${{ inputs.SENTRY_PROJECT }}"
|
|
180
|
-
echo "Debug: API URL=https://sentry.io/api/0/projects/${{ inputs.SENTRY_ORG }}/${{ inputs.SENTRY_PROJECT }}/store/"
|
|
181
|
-
|
|
182
|
-
# First, let's get the DSN for this project
|
|
183
|
-
DSN_RESPONSE=$(curl -s -w "\n%{http_code}" \
|
|
184
|
-
-H "Authorization: Bearer ${{ secrets.SENTRY_AUTH_TOKEN }}" \
|
|
185
|
-
"https://sentry.io/api/0/projects/${{ inputs.SENTRY_ORG }}/${{ inputs.SENTRY_PROJECT }}/keys/")
|
|
186
|
-
|
|
187
|
-
DSN_STATUS=$(echo "$DSN_RESPONSE" | tail -n1)
|
|
188
|
-
DSN_BODY=$(echo "$DSN_RESPONSE" | head -n -1)
|
|
189
|
-
|
|
190
|
-
if [ "$DSN_STATUS" = "200" ]; then
|
|
191
|
-
# Extract the DSN from the first key
|
|
192
|
-
DSN=$(echo "$DSN_BODY" | jq -r '.[0].dsn.public // empty')
|
|
193
|
-
echo "Debug: Found DSN: ${DSN:0:50}..." # Show first 50 chars for security
|
|
194
|
-
|
|
195
|
-
# Parse DSN to get the project ID and key
|
|
196
|
-
if [[ $DSN =~ https://([^@]+)@([^/]+)/([0-9]+) ]]; then
|
|
197
|
-
SENTRY_KEY="${BASH_REMATCH[1]}"
|
|
198
|
-
SENTRY_HOST="${BASH_REMATCH[2]}"
|
|
199
|
-
PROJECT_ID="${BASH_REMATCH[3]}"
|
|
200
|
-
|
|
201
|
-
# Call Sentry API to create issue using the store endpoint with proper auth
|
|
202
|
-
RESPONSE=$(curl -s -w "\n%{http_code}" \
|
|
203
|
-
-H "X-Sentry-Auth: Sentry sentry_version=7, sentry_key=$SENTRY_KEY" \
|
|
204
|
-
-H "Content-Type: application/json" \
|
|
205
|
-
-X POST \
|
|
206
|
-
--data "${PAYLOAD}" \
|
|
207
|
-
"https://${SENTRY_HOST}/api/${PROJECT_ID}/store/")
|
|
208
|
-
else
|
|
209
|
-
echo "Error: Could not parse DSN"
|
|
210
|
-
exit 1
|
|
211
|
-
fi
|
|
212
|
-
else
|
|
213
|
-
echo "Error: Could not retrieve project DSN. Status: $DSN_STATUS"
|
|
214
|
-
echo "Response: $DSN_BODY"
|
|
215
|
-
exit 1
|
|
216
|
-
fi
|
|
217
|
-
|
|
218
|
-
# Extract HTTP status code from response
|
|
219
|
-
HTTP_STATUS=$(echo "$RESPONSE" | tail -n1)
|
|
220
|
-
RESPONSE_BODY=$(echo "$RESPONSE" | head -n -1)
|
|
221
|
-
|
|
222
|
-
echo "HTTP Status: $HTTP_STATUS"
|
|
223
|
-
|
|
224
|
-
if [ "$HTTP_STATUS" = "200" ] || [ "$HTTP_STATUS" = "201" ]; then
|
|
225
|
-
# Extract issue ID from response
|
|
226
|
-
ISSUE_ID=$(echo "$RESPONSE_BODY" | jq -r '.id // empty')
|
|
227
|
-
|
|
228
|
-
if [ -n "$ISSUE_ID" ] && [ "$ISSUE_ID" != "null" ]; then
|
|
229
|
-
echo "Successfully created Sentry issue: $ISSUE_ID"
|
|
230
|
-
echo "issue_id=$ISSUE_ID" >> $GITHUB_OUTPUT
|
|
231
|
-
echo "issue_url=https://sentry.io/organizations/${{ inputs.SENTRY_ORG }}/issues/?project=${{ inputs.SENTRY_PROJECT }}&query=$ISSUE_ID" >> $GITHUB_OUTPUT
|
|
232
|
-
else
|
|
233
|
-
echo "Issue created but no ID returned. Response:"
|
|
234
|
-
echo "$RESPONSE_BODY" | jq . || echo "$RESPONSE_BODY"
|
|
235
|
-
fi
|
|
236
|
-
else
|
|
237
|
-
echo "Failed to create Sentry issue. API response:"
|
|
238
|
-
echo "Status: $HTTP_STATUS"
|
|
239
|
-
echo "Body: $RESPONSE_BODY"
|
|
240
|
-
|
|
241
|
-
# Provide helpful error messages
|
|
242
|
-
if [ "$HTTP_STATUS" = "400" ]; then
|
|
243
|
-
echo "Error: Bad request. Please check the payload format."
|
|
244
|
-
elif [ "$HTTP_STATUS" = "401" ]; then
|
|
245
|
-
echo "Error: Authentication failed. Please check SENTRY_AUTH_TOKEN."
|
|
246
|
-
elif [ "$HTTP_STATUS" = "403" ]; then
|
|
247
|
-
echo "Error: Permission denied. Please check token permissions (needs project:write)."
|
|
248
|
-
elif [ "$HTTP_STATUS" = "404" ]; then
|
|
249
|
-
echo "Error: Project not found. Please check SENTRY_ORG and SENTRY_PROJECT."
|
|
250
|
-
elif [ "$HTTP_STATUS" = "429" ]; then
|
|
251
|
-
echo "Error: Rate limit exceeded. Please try again later."
|
|
252
|
-
fi
|
|
253
|
-
|
|
254
|
-
exit 1
|
|
255
|
-
fi
|
|
256
|
-
|
|
257
|
-
- name: 📢 Report Issue Creation
|
|
258
|
-
if: steps.create_sentry_issue.outputs.issue_id
|
|
259
|
-
run: |
|
|
260
|
-
cd "${{ inputs.working_directory || '.' }}"
|
|
261
|
-
echo "Created Sentry issue: ${{ steps.create_sentry_issue.outputs.issue_id }}"
|
|
262
|
-
echo "Issue URL: ${{ steps.create_sentry_issue.outputs.issue_url }}"
|
|
263
|
-
|
|
264
|
-
- name: 📢 Report Creation Attempt
|
|
265
|
-
if: steps.create_sentry_issue.conclusion == 'success' && !steps.create_sentry_issue.outputs.issue_id
|
|
266
|
-
run: |
|
|
267
|
-
cd "${{ inputs.working_directory || '.' }}"
|
|
268
|
-
echo "Sentry event was sent successfully, but issue ID was not returned."
|
|
269
|
-
echo "Check your Sentry dashboard: https://sentry.io/organizations/${{ inputs.SENTRY_ORG }}/issues/?project=${{ inputs.SENTRY_PROJECT }}"
|