Skip to content

Commit 6349a3e

Browse files
committed
Refactor CI workflows: streamline triggers, enhance Dependabot metadata fetching, and add repo-token for usage report
1 parent b5945a4 commit 6349a3e

6 files changed

Lines changed: 16 additions & 44 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ name: Fake CI
22

33
on:
44
workflow_dispatch:
5-
# push:
6-
# branches:
7-
# - main
5+
pull_request:
6+
branches:
7+
- main
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
# - uses: actions/checkout@v5
15-
- run: echo "Hello, world!"
1614
- run: echo "Hello, world!"
1715
- run: exit 1

.github/workflows/copilot-dependabot-update.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ jobs:
99
if: github.event.pull_request.user.login == 'dependabot[bot]'
1010
steps:
1111
- uses: actions/checkout@v6
12-
1312
- name: Fetch Dependabot metadata
1413
id: metadata
1514
uses: dependabot/fetch-metadata@v2
16-
with:
17-
copilot-token: ${{ secrets.GITHUB_TOKEN }}
18-
1915
- name: Generate dependency analysis with Copilot
2016
uses: austenstone/copilot-cli@main
2117
env:
@@ -47,10 +43,16 @@ jobs:
4743
4844
### 2. Provided Context
4945
46+
#### Dependabot Metadata
5047
```json
5148
${{ toJson(steps.metadata.outputs) }}
5249
```
5350
51+
#### Event Data
52+
```event
53+
${{ toJson(github.event) }}
54+
```
55+
5456
### 3. Your Tasks
5557
5658
Based on the context provided above:
Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,25 @@
11
on:
2-
workflow_call:
3-
schedule:
4-
- cron: '0 * * * *' # Runs every hour
52
issues:
6-
types: [opened, edited, reopened]
3+
types: [opened]
74
pull_request:
5+
types: [opened]
86
branches:
97
- 'main'
10-
workflow_dispatch:
118

129
jobs:
1310
triage:
1411
runs-on: ubuntu-latest
1512
timeout-minutes: 7
16-
outputs:
17-
available_labels: '${{ steps.get_labels.outputs.available_labels }}'
18-
selected_labels: '${{ env.SELECTED_LABELS }}'
1913
permissions:
2014
contents: 'read'
2115
id-token: 'write'
2216
issues: 'read'
2317
pull-requests: 'read'
2418
steps:
25-
- name: 'Get repository labels'
26-
id: get_labels
27-
uses: 'actions/github-script@main'
28-
with:
29-
script: |-
30-
const { data: labels } = await github.rest.issues.listLabelsForRepo({
31-
owner: context.repo.owner,
32-
repo: context.repo.repo,
33-
});
34-
35-
if (!labels || labels.length === 0) {
36-
core.setFailed('There are no issue labels in this repository.')
37-
}
38-
39-
const labelNames = labels.map(label => label.name).sort();
40-
core.setOutput('available_labels', labelNames.join(','));
41-
core.info(`Found ${labelNames.length} labels: ${labelNames.join(', ')}`);
42-
return labelNames;
4319
- uses: austenstone/copilot-cli@main
44-
if: steps.get_labels.outputs.available_labels != ''
4520
env:
46-
GITHUB_TOKEN: '' # Do NOT pass any auth tokens here since this runs on untrusted inputs
4721
ISSUE_TITLE: '${{ github.event.issue.title }}'
4822
ISSUE_BODY: '${{ github.event.issue.body }}'
49-
AVAILABLE_LABELS: '${{ steps.get_labels.outputs.available_labels }}'
5023
with:
5124
copilot-token: ${{ secrets.PAT }}
5225
prompt: |
@@ -61,11 +34,6 @@ jobs:
6134
6235
## Input Data
6336
64-
**Available Labels** (comma-separated):
65-
```
66-
${{ env.AVAILABLE_LABELS }}
67-
```
68-
6937
**Issue Title**:
7038
```
7139
${{ env.ISSUE_TITLE }}
@@ -83,6 +51,8 @@ jobs:
8351
8452
## Steps
8553
54+
0. Fetch possible labels from the repository.
55+
8656
1. Review the issue title, issue body, and available labels provided above.
8757
8858
2. Based on the issue title and issue body, classify the issue and choose all appropriate labels from the list of available labels.

.github/workflows/copilot-research.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
issues:
3-
types: [opened, edited, reopened]
3+
types: [opened]
44

55
jobs:
66
research:

.github/workflows/copilot-security-triage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
- uses: austenstone/copilot-cli@main
1010
with:
1111
copilot-token: ${{ secrets.PAT }}
12+
enable-all-github-mcp-tools: true
1213
prompt: |
1314
## Role
1415

.github/workflows/copilot-usage-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
- uses: austenstone/copilot-cli@main
99
with:
1010
copilot-token: ${{ secrets.PAT }}
11+
repo-token: ${{ secrets.PAT }}
1112
prompt: |
1213
## Role
1314

0 commit comments

Comments
 (0)