Skip to content

chore: replace Python heredoc with inline Node.js script in update-command-line-tools workflow#684

Merged
amyu merged 4 commits intomainfrom
copilot/update-readme-for-version
Feb 24, 2026
Merged

chore: replace Python heredoc with inline Node.js script in update-command-line-tools workflow#684
amyu merged 4 commits intomainfrom
copilot/update-readme-for-version

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

The version-bump cron workflow used a Python <<'EOF' heredoc to patch action.yml and README.md, which was harder to read and inconsistent with the JavaScript already used in the "Create Pull Request" step.

Changes

  • update-command-line-tools.yml: Replaced the Python heredoc with an inline node script using fs.readFileSync/writeFileSync and String.replace() with regex
const fs = require('fs');
const version = process.env.VERSION;

let actionYml = fs.readFileSync('action.yml', 'utf8');
actionYml = actionYml.replace(
  /(  command-line-tools-version:[\s\S]*?default: ")[^"]*"/,
  `$1${version}"`
);
fs.writeFileSync('action.yml', actionYml);

let readme = fs.readFileSync('README.md', 'utf8');
readme = readme.replace(/(command-line-tools-version: )\d+/, `$1${version}`);
readme = readme.replace(
  /(# default: )\d+(\n\s*# see https:\/\/developer\.android\.com\/studio#command-tools)/,
  `$1${version}$2`
);
fs.writeFileSync('README.md', readme);

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: amyu <5638112+amyu@users.noreply.github.com>
Copilot AI changed the title [WIP] Update README to reflect version changes Fix: include README.md in command-line-tools version update workflow Feb 23, 2026
Copilot AI requested a review from amyu February 23, 2026 08:41
Copilot AI and others added 2 commits February 23, 2026 09:01
Co-authored-by: amyu <5638112+amyu@users.noreply.github.com>
…ADME.md

Co-authored-by: amyu <5638112+amyu@users.noreply.github.com>
Copilot AI changed the title Fix: include README.md in command-line-tools version update workflow chore: replace Python heredoc with inline Node.js script in update-command-line-tools workflow Feb 23, 2026
@amyu amyu marked this pull request as ready for review February 23, 2026 09:04
@amyu amyu merged commit 87ba5cd into main Feb 24, 2026
35 checks passed
@amyu amyu deleted the copilot/update-readme-for-version branch February 24, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants