-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (38 loc) · 1.58 KB
/
update_submodules_issue.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Create Submodule Update Issue
on:
schedule:
- cron: '0 0 15 * *' # Run on the 15th of each month
workflow_dispatch: # Allow manual triggering
permissions:
issues: write
contents: read
jobs:
create-issue:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Parse .gitmodules and create issue
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
// Read and parse .gitmodules file
const gitmodulesPath = path.join(process.env.GITHUB_WORKSPACE, '.gitmodules');
const gitmodulesContent = fs.readFileSync(gitmodulesPath, 'utf8');
// Extract submodule paths
const submodules = gitmodulesContent.match(/path = .+/g).map(line => line.split(' = ')[1].trim());
// Create checkbox list
const checkboxList = submodules.map(submodule => `- [ ] ${submodule}`).join('\n');
// Create issue
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Update submodules',
body: `It's time to update our forks and submodules. Check for upstream updates and merge them if necessary.
Don't forget to use [the guide](https://github.com/alpaca-core/alpaca-core/blob/master/doc/dev/updating-submodules.md).
Subbmodules to update:
${checkboxList}`,
labels: ['refactor']
});