Skip to content

Commit 3f4cecd

Browse files
committed
sd
1 parent 017286c commit 3f4cecd

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

.github/workflows/cl.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ jobs:
4141
- name: Format Check
4242
run: node ./tools/index.js
4343

44-
- name: Push changes # push the output folder to your repo
45-
uses: ad-m/github-push-action@master
44+
- name: Try commit
45+
uses: EndBug/add-and-commit@v9
4646
with:
47-
github_token: ${{ secrets.GH_PAT }}
48-
force: true
49-
force_with_lease: true
47+
add: 'scripts'

tools/packageReadme.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,19 @@ import { parseHeader } from "./header-parser";
55
import { readmeFilenames, scripts, scriptsPath } from "./utils";
66

77
function pushCommitGit (packages: string[]) {
8-
// add auth token
9-
writeFileSync('./github-token', process.env.PR_TOKEN ?? '');
10-
11-
// github commit push
128
const title = `Add README to ${packages.length} packages`;
139
const description = [
1410
`Add README file to the following packages:`,
1511
packages.join(', ')
1612
];
1713
const commands = [
1814
"git --version",
19-
'git config --global user.email "[email protected]"',
20-
'git config --global user.name "github-actions"',
21-
"git add ./scripts",
15+
'git config user.email "41898282+github-actions[bot]@users.noreply.github.com"',
16+
'git config user.name "github-actions[bot]"',
2217
"git status",
18+
"git add scripts",
2319
`git commit -m ${JSON.stringify(title)} -m ${JSON.stringify(description.join('\n'))}`,
20+
"git push origin HEAD:" + process.env.REF,
2421
];
2522

2623
for (const cmd of commands) {
@@ -98,7 +95,7 @@ export function execute (): 0 | 1 {
9895
}
9996

10097
// attempt to commit
101-
if (scriptsChanged.length > 0) pushCommitGit(scriptsChanged);
98+
if (scriptsChanged.length > 0) console.warn(`Add README to ${scriptsChanged.length} packages`);
10299
else console.log("All script packages have a README file.");
103100

104101
return 0;

0 commit comments

Comments
 (0)