Skip to content

Commit 98f2aae

Browse files
DavidKRKCopilotCopilot
authored
Copilot/fix background music page (#183)
* Initial commit of WordPress site * feat: Mise à jour des actions GitHub et page d'accueil - Met à jour les actions GitHub (checkout, create-github-app-token, run-gemini-cli) vers les dernières versions. * fix: social-media-post workflow yaml valid on master * fix: restore background-image on index.html, isolate music-page class Agent-Logs-Url: https://github.com/DavidKRK/DavidKRK.github.io/sessions/5d42fd6d-80f7-40cc-a2fe-311924b01ece Co-authored-by: DavidKRK <136035295+DavidKRK@users.noreply.github.com> * Update assets/css/style.css Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: update all non-home pages to use page-specific body classes Agent-Logs-Url: https://github.com/DavidKRK/DavidKRK.github.io/sessions/a7c79463-e3b3-4a62-94a6-3ba779a4d323 Co-authored-by: DavidKRK <136035295+DavidKRK@users.noreply.github.com> * fix: apply owl background image to all pages, fix duplicate image on index.html Agent-Logs-Url: https://github.com/DavidKRK/DavidKRK.github.io/sessions/f81d8838-a528-4d5e-ae5a-1eee4cca10df Co-authored-by: DavidKRK <136035295+DavidKRK@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 91a4025 commit 98f2aae

3,467 files changed

Lines changed: 1460604 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/gemini-cli.yml

Lines changed: 315 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
name: '🏷️ Gemini Automated Issue Triage'
2+
3+
on:
4+
issues:
5+
types:
6+
- 'opened'
7+
- 'reopened'
8+
issue_comment:
9+
types:
10+
- 'created'
11+
workflow_dispatch:
12+
inputs:
13+
issue_number:
14+
description: 'issue number to triage'
15+
required: true
16+
type: 'number'
17+
18+
concurrency:
19+
group: '${{ github.workflow }}-${{ github.event.issue.number }}'
20+
cancel-in-progress: true
21+
22+
defaults:
23+
run:
24+
shell: 'bash'
25+
26+
permissions:
27+
contents: 'read'
28+
id-token: 'write'
29+
issues: 'write'
30+
statuses: 'write'
31+
32+
jobs:
33+
triage-issue:
34+
if: |-
35+
github.event_name == 'issues' ||
36+
github.event_name == 'workflow_dispatch' ||
37+
(
38+
github.event_name == 'issue_comment' &&
39+
contains(github.event.comment.body, '@gemini-cli /triage') &&
40+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
41+
)
42+
timeout-minutes: 5
43+
runs-on: 'ubuntu-latest'
44+
steps:
45+
- name: 'Checkout repository'
46+
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4
47+
48+
- name: 'Generate GitHub App Token'
49+
id: 'generate_token'
50+
if: |-
51+
${{ vars.APP_ID }}
52+
uses: 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' # ratchet:actions/create-github-app-token@v2
53+
with:
54+
app-id: '${{ vars.APP_ID }}'
55+
private-key: '${{ secrets.APP_PRIVATE_KEY }}'
56+
57+
- name: 'Get Repository Labels'
58+
id: 'get_labels'
59+
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea'
60+
with:
61+
github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
62+
script: |-
63+
const { data: labels } = await github.rest.issues.listLabelsForRepo({
64+
owner: context.repo.owner,
65+
repo: context.repo.repo,
66+
});
67+
const labelNames = labels.map(label => label.name);
68+
core.setOutput('available_labels', labelNames.join(','));
69+
core.info(`Found ${labelNames.length} labels: ${labelNames.join(', ')}`);
70+
return labelNames;
71+
72+
- name: 'Run Gemini Issue Analysis'
73+
uses: 'google-github-actions/run-gemini-cli@v0.1.10'
74+
id: 'gemini_issue_analysis'
75+
env:
76+
GITHUB_TOKEN: '' # Do not pass any auth token here since this runs on untrusted inputs
77+
ISSUE_TITLE: '${{ github.event.issue.title }}'
78+
ISSUE_BODY: '${{ github.event.issue.body }}'
79+
ISSUE_NUMBER: '${{ github.event.issue.number }}'
80+
REPOSITORY: '${{ github.repository }}'
81+
AVAILABLE_LABELS: '${{ steps.get_labels.outputs.available_labels }}'
82+
with:
83+
gemini_cli_version: '${{ vars.GEMINI_CLI_VERSION }}'
84+
gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'
85+
gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}'
86+
gcp_location: '${{ vars.GOOGLE_CLOUD_LOCATION }}'
87+
gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
88+
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
89+
use_vertex_ai: '${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}'
90+
use_gemini_code_assist: '${{ vars.GOOGLE_GENAI_USE_GCA }}'
91+
settings: |-
92+
{
93+
"debug": ${{ fromJSON(env.DEBUG || env.ACTIONS_STEP_DEBUG || false) }},
94+
"maxSessionTurns": 25,
95+
"coreTools": [
96+
"run_shell_command(echo)"
97+
],
98+
"telemetry": {
99+
"enabled": false,
100+
"target": "gcp"
101+
}
102+
}
103+
prompt: |-
104+
## Role
105+
106+
You are an issue triage assistant. Analyze the current GitHub issue
107+
and identify the most appropriate existing labels. Use the available
108+
tools to gather information; do not ask for information to be
109+
provided.
110+
111+
## Steps
112+
113+
1. Review the available labels in the environment variable: "${AVAILABLE_LABELS}".
114+
2. Review the issue title and body provided in the environment
115+
variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}".
116+
3. Classify the issue by the appropriate labels from the available labels.
117+
4. Output the appropriate labels for this issue in JSON format with explanation, for example:
118+
```
119+
{"labels_to_set": ["kind/bug", "priority/p0"], "explanation": "This is a critical bug report affecting main functionality"}
120+
```
121+
5. If the issue cannot be classified using the available labels, output:
122+
```
123+
{"labels_to_set": [], "explanation": "Unable to classify this issue with available labels"}
124+
```
125+
126+
## Guidelines
127+
128+
- Only use labels that already exist in the repository
129+
- Assign all applicable labels based on the issue content
130+
- Reference all shell variables as "${VAR}" (with quotes and braces)
131+
- Output only valid JSON format
132+
- Do not include any explanation or additional text, just the JSON
133+
134+
- name: 'Apply Labels to Issue'
135+
if: |-
136+
${{ steps.gemini_issue_analysis.outputs.summary != '' }}
137+
env:
138+
REPOSITORY: '${{ github.repository }}'
139+
ISSUE_NUMBER: '${{ github.event.issue.number }}'
140+
LABELS_OUTPUT: '${{ steps.gemini_issue_analysis.outputs.summary }}'
141+
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea'
142+
with:
143+
github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
144+
script: |-
145+
// Strip code block markers if present
146+
const rawLabels = process.env.LABELS_OUTPUT;
147+
core.info(`Raw labels JSON: ${rawLabels}`);
148+
let parsedLabels;
149+
try {
150+
const trimmedLabels = rawLabels.replace(/^```(?:json)?\s*/, '').replace(/\s*```$/, '').trim();
151+
parsedLabels = JSON.parse(trimmedLabels);
152+
core.info(`Parsed labels JSON: ${JSON.stringify(parsedLabels)}`);
153+
} catch (err) {
154+
core.setFailed(`Failed to parse labels JSON from Gemini output: ${err.message}\nRaw output: ${rawLabels}`);
155+
return;
156+
}
157+
158+
const issueNumber = parseInt(process.env.ISSUE_NUMBER);
159+
160+
// Set labels based on triage result
161+
if (parsedLabels.labels_to_set && parsedLabels.labels_to_set.length > 0) {
162+
await github.rest.issues.setLabels({
163+
owner: context.repo.owner,
164+
repo: context.repo.repo,
165+
issue_number: issueNumber,
166+
labels: parsedLabels.labels_to_set
167+
});
168+
const explanation = parsedLabels.explanation ? ` - ${parsedLabels.explanation}` : '';
169+
core.info(`Successfully set labels for #${issueNumber}: ${parsedLabels.labels_to_set.join(', ')}${explanation}`);
170+
} else {
171+
// If no labels to set, leave the issue as is
172+
const explanation = parsedLabels.explanation ? ` - ${parsedLabels.explanation}` : '';
173+
core.info(`No labels to set for #${issueNumber}, leaving as is${explanation}`);
174+
}
175+
176+
- name: 'Post Issue Analysis Failure Comment'
177+
if: |-
178+
${{ failure() && steps.gemini_issue_analysis.outcome == 'failure' }}
179+
env:
180+
ISSUE_NUMBER: '${{ github.event.issue.number }}'
181+
RUN_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
182+
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea'
183+
with:
184+
github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
185+
script: |-
186+
github.rest.issues.createComment({
187+
owner: context.repo.owner,
188+
repo: context.repo.repo,
189+
issue_number: parseInt(process.env.ISSUE_NUMBER),
190+
body: 'There is a problem with the Gemini CLI issue triaging. Please check the [action logs](${process.env.RUN_URL}) for details.'
191+
})
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: '📋 Gemini Scheduled Issue Triage'
2+
3+
on:
4+
schedule:
5+
- cron: '0 * * * *' # Runs every hour
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: '${{ github.workflow }}'
10+
cancel-in-progress: true
11+
12+
defaults:
13+
run:
14+
shell: 'bash'
15+
16+
permissions:
17+
contents: 'read'
18+
id-token: 'write'
19+
issues: 'write'
20+
statuses: 'write'
21+
22+
jobs:
23+
triage-issues:
24+
timeout-minutes: 5
25+
runs-on: 'ubuntu-latest'
26+
steps:
27+
- name: 'Checkout repository'
28+
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4
29+
30+
- name: 'Generate GitHub App Token'
31+
id: 'generate_token'
32+
if: |-
33+
${{ vars.APP_ID }}
34+
uses: 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' # ratchet:actions/create-github-app-token@v2
35+
with:
36+
app-id: '${{ vars.APP_ID }}'
37+
private-key: '${{ secrets.APP_PRIVATE_KEY }}'
38+
39+
- name: 'Find untriaged issues'
40+
id: 'find_issues'
41+
env:
42+
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
43+
GITHUB_REPOSITORY: '${{ github.repository }}'
44+
GITHUB_OUTPUT: '${{ github.output }}'
45+
run: |-
46+
set -euo pipefail
47+
48+
echo '🔍 Finding issues without labels...'
49+
NO_LABEL_ISSUES="$(gh issue list --repo "${GITHUB_REPOSITORY}" \
50+
--search 'is:open is:issue no:label' --json number,title,body)"
51+
52+
echo '🏷️ Finding issues that need triage...'
53+
NEED_TRIAGE_ISSUES="$(gh issue list --repo "${GITHUB_REPOSITORY}" \
54+
--search 'is:open is:issue label:"status/needs-triage"' --json number,title,body)"
55+
56+
echo '🔄 Merging and deduplicating issues...'
57+
ISSUES="$(echo "${NO_LABEL_ISSUES}" "${NEED_TRIAGE_ISSUES}" | jq -c -s 'add | unique_by(.number)')"
58+
59+
echo '📝 Setting output for GitHub Actions...'
60+
echo "issues_to_triage=${ISSUES}" >> "${GITHUB_OUTPUT}"
61+
62+
ISSUE_COUNT="$(echo "${ISSUES}" | jq 'length')"
63+
echo "✅ Found ${ISSUE_COUNT} issues to triage! 🎯"
64+
65+
- name: 'Get Repository Labels'
66+
id: 'get_labels'
67+
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea'
68+
with:
69+
github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
70+
script: |-
71+
const { data: labels } = await github.rest.issues.listLabelsForRepo({
72+
owner: context.repo.owner,
73+
repo: context.repo.repo,
74+
});
75+
const labelNames = labels.map(label => label.name);
76+
core.setOutput('available_labels', labelNames.join(','));
77+
core.info(`Found ${labelNames.length} labels: ${labelNames.join(', ')}`);
78+
return labelNames;
79+
80+
- name: 'Run Gemini Issue Analysis'
81+
if: |-
82+
${{ steps.find_issues.outputs.issues_to_triage != '[]' }}
83+
uses: 'google-github-actions/run-gemini-cli@v0.1.10'
84+
id: 'gemini_issue_analysis'
85+
env:
86+
GITHUB_TOKEN: '' # Do not pass any auth token here since this runs on untrusted inputs
87+
ISSUES_TO_TRIAGE: '${{ steps.find_issues.outputs.issues_to_triage }}'
88+
REPOSITORY: '${{ github.repository }}'
89+
AVAILABLE_LABELS: '${{ steps.get_labels.outputs.available_labels }}'
90+
with:
91+
gemini_cli_version: '${{ vars.GEMINI_CLI_VERSION }}'
92+
gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'
93+
gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}'
94+
gcp_location: '${{ vars.GOOGLE_CLOUD_LOCATION }}'
95+
gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
96+
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
97+
use_vertex_ai: '${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}'
98+
use_gemini_code_assist: '${{ vars.GOOGLE_GENAI_USE_GCA }}'
99+
settings: |-
100+
{
101+
"debug": ${{ fromJSON(env.DEBUG || env.ACTIONS_STEP_DEBUG || false) }},
102+
"maxSessionTurns": 25,
103+
"coreTools": [
104+
"run_shell_command(echo)"
105+
],
106+
"telemetry": {
107+
"enabled": false,
108+
"target": "gcp"
109+
}
110+
}
111+
prompt: |-
112+
## Role
113+
114+
You are an issue triage assistant. Analyze the GitHub issues and
115+
identify the most appropriate existing labels to apply.
116+
117+
## Steps
118+
119+
1. Review the available labels in the environment variable: "${AVAILABLE_LABELS}".
120+
2. Review the issues in the environment variable: "${ISSUES_TO_TRIAGE}".
121+
3. For each issue, classify it by the appropriate labels from the available labels.
122+
4. Output a JSON array of objects, each containing the issue number,
123+
the labels to set, and a brief explanation. For example:
124+
```
125+
[
126+
{
127+
"issue_number": 123,
128+
"labels_to_set": ["kind/bug", "priority/p2"],
129+
"explanation": "This is a bug report with high priority based on the error description"
130+
},
131+
{
132+
"issue_number": 456,
133+
"labels_to_set": ["kind/enhancement"],
134+
"explanation": "This is a feature request for improving the UI"
135+
}
136+
]
137+
```
138+
5. If an issue cannot be classified, do not include it in the output array.
139+
140+
## Guidelines
141+
142+
- Only use labels that already exist in the repository
143+
- Assign all applicable labels based on the issue content
144+
- Reference all shell variables as "${VAR}" (with quotes and braces)
145+
- Output only valid JSON format
146+
- Do not include any explanation or additional text, just the JSON
147+
148+
- name: 'Apply Labels to Issues'
149+
if: |-
150+
${{ steps.gemini_issue_analysis.outcome == 'success' &&
151+
steps.gemini_issue_analysis.outputs.summary != '[]' }}
152+
env:
153+
REPOSITORY: '${{ github.repository }}'
154+
LABELS_OUTPUT: '${{ steps.gemini_issue_analysis.outputs.summary }}'
155+
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea'
156+
with:
157+
github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
158+
script: |-
159+
// Strip code block markers if present
160+
const rawLabels = process.env.LABELS_OUTPUT;
161+
core.info(`Raw labels JSON: ${rawLabels}`);
162+
let parsedLabels;
163+
try {
164+
const trimmedLabels = rawLabels.replace(/^```(?:json)?\s*/, '').replace(/\s*```$/, '').trim();
165+
parsedLabels = JSON.parse(trimmedLabels);
166+
core.info(`Parsed labels JSON: ${JSON.stringify(parsedLabels)}`);
167+
} catch (err) {
168+
core.setFailed(`Failed to parse labels JSON from Gemini output: ${err.message}\nRaw output: ${rawLabels}`);
169+
return;
170+
}
171+
172+
for (const entry of parsedLabels) {
173+
const issueNumber = entry.issue_number;
174+
if (!issueNumber) {
175+
core.info(`Skipping entry with no issue number: ${JSON.stringify(entry)}`);
176+
continue;
177+
}
178+
179+
// Set labels based on triage result
180+
if (entry.labels_to_set && entry.labels_to_set.length > 0) {
181+
await github.rest.issues.setLabels({
182+
owner: context.repo.owner,
183+
repo: context.repo.repo,
184+
issue_number: issueNumber,
185+
labels: entry.labels_to_set
186+
});
187+
const explanation = entry.explanation ? ` - ${entry.explanation}` : '';
188+
core.info(`Successfully set labels for #${issueNumber}: ${entry.labels_to_set.join(', ')}${explanation}`);
189+
} else {
190+
// If no labels to set, leave the issue as is
191+
core.info(`No labels to set for #${issueNumber}, leaving as is`);
192+
}
193+
}

0 commit comments

Comments
 (0)