INNER CODE UNIT · TypeScript
changedFiles
dtinth/todo-actions · src/CodeRepository.ts:67
const changedFiles = files.filter(file => file.contents.changed)
log.info('Files changed: %s', changedFiles.length)
if (changedFiles.length === 0) {
return
}
for (const file of changedFiles) {
file.save()
}
execFileSync('git', ['add', ...changedFiles.map(file => file.fileName)])
execFileSync('git', ['commit', '-m', commitMessage], {
stdio: 'inherit',
})
if (!process.env.GITHUB_TOKEN) {
throw `Maybe you forgot to enable the GITHUB_TOKEN secret?`
}
execSync(
'git push "https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:"$GITHUB_REF"',
{ stdio: 'inherit' },