From 9d09f5f6130fa37a3d44a42520c3e6babb53c718 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Fri, 9 Feb 2024 08:08:04 -0500 Subject: [PATCH 1/3] ci(workflows): enable prettier for forks --- .github/workflows/update-prettier.yml | 33 +++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-prettier.yml b/.github/workflows/update-prettier.yml index e5c37af84..f12fee885 100644 --- a/.github/workflows/update-prettier.yml +++ b/.github/workflows/update-prettier.yml @@ -4,17 +4,18 @@ name: Update Prettier branches: - renovate/prettier-* -permissions: - contents: read - jobs: update_prettier: + if: github.repository_owner == 'octokit' runs-on: ubuntu-latest + permissions: + contents: read + steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 cache: npm - run: npm ci - run: npm run lint:fix @@ -26,3 +27,27 @@ jobs: body: An update to prettier required updates to your code. branch: ${{ github.ref }} commit-message: "style: prettier" + + update_prettier_fork: + if: github.repository_owner != 'octokit' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npm run lint:fix + - uses: gr2m/create-or-update-pull-request-action@v1.x + env: + GITHUB_TOKEN: ${{ github.token }} + with: + title: Prettier updated + body: An update to prettier required updates to your code. + branch: ${{ github.ref }} + commit-message: "style: prettier" From 019e8a439463ba411137753f7aad155e7e515a7d Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Fri, 9 Feb 2024 08:11:34 -0500 Subject: [PATCH 2/3] trigger linter --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index c3e578728..acdbd8319 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ import { VERSION } from "./version.js"; import withDefaults from "./with-defaults.js"; export const request = withDefaults(endpoint, { - headers: { + headers: { "user-agent": `octokit-request.js/${VERSION} ${getUserAgent()}`, }, }); From 950d6fa420b36abeb5e83a8c7c03dcbb7e10cbe7 Mon Sep 17 00:00:00 2001 From: Create or Update Pull Request Action Date: Fri, 9 Feb 2024 13:11:58 +0000 Subject: [PATCH 3/3] style: prettier --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index acdbd8319..c3e578728 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ import { VERSION } from "./version.js"; import withDefaults from "./with-defaults.js"; export const request = withDefaults(endpoint, { - headers: { + headers: { "user-agent": `octokit-request.js/${VERSION} ${getUserAgent()}`, }, });