diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2024-03-01 11:11:32 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-01 11:11:32 -0500 |
| commit | 7ac040833025bf234dec485ddaa6c459b25d2196 (patch) | |
| tree | 82f036bd96100575ab17d1616b55d54b5d21a1df /.github/workflows | |
| parent | 878384aefaafacb2dc875ba1d7ea9d4af01d2cf0 (diff) | |
ci: actually fix workflow permissions (#22644)
Also adds a lint to ensure this file is kept up to date.
Diffstat (limited to '.github/workflows')
| -rwxr-xr-x | .github/workflows/ci.generate.ts | 24 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 2 |
2 files changed, 19 insertions, 7 deletions
diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index 01eb04315..b2a8c99c9 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -301,6 +301,9 @@ function handleMatrixItems(items: { const ci = { name: "ci", + permissions: { + contents: "write", + }, on: { push: { branches: ["main"], @@ -1075,11 +1078,18 @@ const ci = { }, }; -let finalText = `# GENERATED BY ./ci.generate.ts -- DO NOT DIRECTLY EDIT\n\n`; -finalText += yaml.stringify(ci, { - noRefs: true, - lineWidth: 10_000, - noCompatMode: true, -}); +export function generate() { + let finalText = `# GENERATED BY ./ci.generate.ts -- DO NOT DIRECTLY EDIT\n\n`; + finalText += yaml.stringify(ci, { + noRefs: true, + lineWidth: 10_000, + noCompatMode: true, + }); + return finalText; +} + +export const CI_YML_URL = new URL("./ci.yml", import.meta.url); -Deno.writeTextFileSync(new URL("./ci.yml", import.meta.url), finalText); +if (import.meta.main) { + Deno.writeTextFileSync(CI_YML_URL, generate()); +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17157ce5b..b36195beb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,8 @@ # GENERATED BY ./ci.generate.ts -- DO NOT DIRECTLY EDIT name: ci +permissions: + contents: write on: push: branches: |
