Skip to content

Commit 4d1e84e

Browse files
authored
fix: use correct github token name (#216)
1 parent 326cc48 commit 4d1e84e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ module.exports = async function main() {
457457
await command(`git add .github/workflows/test.yml`);
458458
await command(`git commit -m 'ci(test): initial version'`);
459459

460-
await createUpdatePrettierAction();
460+
await createUpdatePrettierAction({ owner });
461461
await command(`git add .github/workflows/update-prettier.yml`);
462462
await command(`git commit -m 'ci(update-prettier): initial version'`);
463463

lib/create-update-prettier-action.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ module.exports = createUpdatePrettierAction;
22

33
const writePrettyFile = require("./write-pretty-file");
44

5-
async function createUpdatePrettierAction() {
5+
async function createUpdatePrettierAction({ owner }) {
6+
const githubTokenSecretName =
7+
owner === "octokit" ? "OCTOKITBOT_PAT" : "GITHUB_TOKEN";
8+
69
await writePrettyFile(
710
".github/workflows/update-prettier.yml",
811
`name: Update Prettier
@@ -24,7 +27,7 @@ jobs:
2427
- run: npm run lint:fix
2528
- uses: gr2m/[email protected]
2629
env:
27-
GITHUB_TOKEN: \${{ secrets.OCTOKITBOT_PAT }}
30+
GITHUB_TOKEN: \${{ secrets.${githubTokenSecretName} }}
2831
with:
2932
title: "Prettier updated"
3033
body: "An update to prettier required updates to your code."

0 commit comments

Comments
 (0)