Skip to content

automation: Add GitHub action to schedule issue for submodule update.… #1

automation: Add GitHub action to schedule issue for submodule update.…

automation: Add GitHub action to schedule issue for submodule update.… #1

name: Create Submodule Update Issue
on:
schedule:
- cron: '0 0 */15 * *' # Run every 15 days
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 the submodules. Please check for updates and merge them if necessary.
Submodules to update:
${checkboxList}`,

Check failure on line 46 in .github/workflows/update_submodules_issue.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/update_submodules_issue.yml

Invalid workflow file

You have an error in your yaml syntax on line 46
labels: ['maintenance']
});