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"