Skip to content

Commit

Permalink
Run prettier on everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberboss committed Oct 27, 2024
1 parent bcd7ab1 commit dc8283d
Show file tree
Hide file tree
Showing 26 changed files with 1,596 additions and 1,559 deletions.
134 changes: 67 additions & 67 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,86 +6,86 @@ on:
- next
- graphql
pull_request:
branches:
- next
- graphql
branches:
- next
- graphql

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
# expect used for unbuffer
- name: Install Native Dependencies
run: |
sudo apt-get update
sudo apt-get install expect
- name: Install Native Dependencies
run: |
sudo apt-get update
sudo apt-get install expect
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Restore Yarn cache
uses: actions/cache@v4
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Restore Yarn cache
uses: actions/cache@v4
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Setup Yarn
run: corepack enable
- name: Setup Yarn
run: corepack enable

- name: Install Yarn Dependencies
run: |
unbuffer yarn install --immutable | tee yarn_output.log
if cat yarn_output.log | grep YN0060; then
echo "Detected incompatible peer dependencies!"
exit 1
fi
- name: Install Yarn Dependencies
run: |
unbuffer yarn install --immutable | tee yarn_output.log
if cat yarn_output.log | grep YN0060; then
echo "Detected incompatible peer dependencies!"
exit 1
fi
- name: Compile
run: |
unbuffer yarn build | tee yarn_output.log
if cat yarn_output.log | grep build.chunkSizeWarningLimit; then
echo "Detected chunk size warning peer dependencies!"
exit 1
fi
- name: Compile
run: |
unbuffer yarn build | tee yarn_output.log
if cat yarn_output.log | grep build.chunkSizeWarningLimit; then
echo "Detected chunk size warning peer dependencies!"
exit 1
fi
lint:
name: Run Linter
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout
uses: actions/checkout@v4
lint:
name: Run Linter
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Restore Yarn cache
uses: actions/cache@v4
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Restore Yarn cache
uses: actions/cache@v4
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Setup Yarn
run: corepack enable
- name: Setup Yarn
run: corepack enable

- name: Install Dependencies
run: yarn
- name: Install Dependencies
run: yarn

- name: Run ESLint
run: yarn eslint "**/*.{js,jsx,ts,tsx}"
- name: Run ESLint
run: yarn eslint "**/*.{js,jsx,ts,tsx}"

- name: Run Prettier
run: yarn prettier -c .
- name: Run Prettier
run: yarn prettier -c .
50 changes: 25 additions & 25 deletions .github/workflows/auto-approve-dominions-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@
name: "Auto-Approve Dominion's PRs"

on:
pull_request_target:
branches:
- next
- graphql
pull_request_target:
branches:
- next
- graphql

concurrency:
group: "approve-dominion-${{ github.head_ref || github.run_id }}-${{ github.event_name }}"
cancel-in-progress: true
group: "approve-dominion-${{ github.head_ref || github.run_id }}-${{ github.event_name }}"
cancel-in-progress: true

jobs:
approve-pr-if-dominion-is-author:
name: Approve PR if Dominion is Author
if: github.event.pull_request.user.id == 8171642 && !github.event.pull_request.draft && !contains(github.event.pull_request.body, '- [ ]') && (github.event.pull_request.base.repo.owner.login == 'tgstation' || github.event.pull_request.base.repo.owner.login == 'Cyberboss')
runs-on: ubuntu-latest
steps:
- name: Generate App Token
id: app-token-generation
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
approve-pr-if-dominion-is-author:
name: Approve PR if Dominion is Author
if: github.event.pull_request.user.id == 8171642 && !github.event.pull_request.draft && !contains(github.event.pull_request.body, '- [ ]') && (github.event.pull_request.base.repo.owner.login == 'tgstation' || github.event.pull_request.base.repo.owner.login == 'Cyberboss')
runs-on: ubuntu-latest
steps:
- name: Generate App Token
id: app-token-generation
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: GitHub API Call
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/pulls/${{github.event.number}}/reviews \
--header 'authorization: Bearer ${{ steps.app-token-generation.outputs.token }}' \
--header 'content-type: application/json' \
-d '{"event":"APPROVE"}' \
--fail
- name: GitHub API Call
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/pulls/${{github.event.number}}/reviews \
--header 'authorization: Bearer ${{ steps.app-token-generation.outputs.token }}' \
--header 'content-type: application/json' \
-d '{"event":"APPROVE"}' \
--fail
134 changes: 67 additions & 67 deletions .github/workflows/chromatic-security.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
name: Chromatic Security

on:
pull_request:
branches:
- next
- graphql
pull_request_target:
types:
- opened
- reopened
- labeled
- synchronize
branches:
- next
- graphql
pull_request:
branches:
- next
- graphql
pull_request_target:
types:
- opened
- reopened
- labeled
- synchronize
branches:
- next
- graphql

concurrency:
group: "chromatic-security-${{ github.head_ref || github.run_id }}-${{ github.event_name }}"
cancel-in-progress: true
group: "chromatic-security-${{ github.head_ref || github.run_id }}-${{ github.event_name }}"
cancel-in-progress: true

jobs:
security-checkpoint:
name: Check Chromatic Clearance
if: github.event_name == 'pull_request_target' && (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id || github.event.pull_request.user.id == 49699333) && github.event.pull_request.state == 'open'
runs-on: ubuntu-latest
steps:
- name: Generate App Token
id: app-token-generation
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
security-checkpoint:
name: Check Chromatic Clearance
if: github.event_name == 'pull_request_target' && (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id || github.event.pull_request.user.id == 49699333) && github.event.pull_request.state == 'open'
runs-on: ubuntu-latest
steps:
- name: Generate App Token
id: app-token-generation
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Comment on new Fork PR
if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'CI Cleared') && github.event.pull_request.user.id != 49699333
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6
with:
message: Thank you for contributing to ${{ github.event.pull_request.base.repo.name }}! The workflow '${{ github.workflow }}' requires repository secrets and will not run without approval. Maintainers can add the `CI Cleared` label to allow it to run. Note that any changes to chromaitc-security.yml and chromatic.yml will not be reflected.
GITHUB_TOKEN: ${{ steps.app-token-generation.outputs.token }}
- name: Comment on new Fork PR
if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'CI Cleared') && github.event.pull_request.user.id != 49699333
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6
with:
message: Thank you for contributing to ${{ github.event.pull_request.base.repo.name }}! The workflow '${{ github.workflow }}' requires repository secrets and will not run without approval. Maintainers can add the `CI Cleared` label to allow it to run. Note that any changes to chromaitc-security.yml and chromatic.yml will not be reflected.
GITHUB_TOKEN: ${{ steps.app-token-generation.outputs.token }}

- name: Comment on dependabot PR
if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'CI Cleared') && github.event.pull_request.user.id == 49699333
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6
with:
message: Set the milestone to the next ${{ (github.head_ref == 'master' && 'patch') || 'minor' }} version, check for supply chain attacks, and then add the `CI Cleared` label to allow CI to run.
GITHUB_TOKEN: ${{ steps.app-token-generation.outputs.token }}
- name: Comment on dependabot PR
if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'CI Cleared') && github.event.pull_request.user.id == 49699333
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6
with:
message: Set the milestone to the next ${{ (github.head_ref == 'master' && 'patch') || 'minor' }} version, check for supply chain attacks, and then add the `CI Cleared` label to allow CI to run.
GITHUB_TOKEN: ${{ steps.app-token-generation.outputs.token }}

- name: "Remove Stale 'CI Cleared' Label"
if: github.event.action == 'synchronize' || github.event.action == 'reopened'
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
with:
labels: CI Cleared
github_token: ${{ steps.app-token-generation.outputs.token }}
- name: "Remove Stale 'CI Cleared' Label"
if: github.event.action == 'synchronize' || github.event.action == 'reopened'
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
with:
labels: CI Cleared
github_token: ${{ steps.app-token-generation.outputs.token }}

- name: "Remove 'CI Approval Required' Label"
if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
with:
labels: CI Approval Required
github_token: ${{ steps.app-token-generation.outputs.token }}
- name: "Remove 'CI Approval Required' Label"
if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
with:
labels: CI Approval Required
github_token: ${{ steps.app-token-generation.outputs.token }}

- name: "Add 'CI Approval Required' Label"
if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && !contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
with:
labels: CI Approval Required
github_token: ${{ steps.app-token-generation.outputs.token }}
- name: "Add 'CI Approval Required' Label"
if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && !contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
with:
labels: CI Approval Required
github_token: ${{ steps.app-token-generation.outputs.token }}

- name: Fail if PR has Unlabeled new Commits from User
if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && !contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
run: exit 1
- name: Fail if PR has Unlabeled new Commits from User
if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && !contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
run: exit 1

chromatic-workflow-call:
name: Chromatic
needs: security-checkpoint
if: (!(cancelled() || failure()) && (needs.security-checkpoint.result == 'success' || (github.event_name != 'pull_request_target' && github.event.pull_request.head.repo.id == github.event.pull_request.base.repo.id && github.event.pull_request.user.id != 49699333)))
uses: ./.github/workflows/chromatic.yml
secrets: inherit
with:
pull_request_number: ${{ github.event.pull_request.number }}
chromatic-workflow-call:
name: Chromatic
needs: security-checkpoint
if: (!(cancelled() || failure()) && (needs.security-checkpoint.result == 'success' || (github.event_name != 'pull_request_target' && github.event.pull_request.head.repo.id == github.event.pull_request.base.repo.id && github.event.pull_request.user.id != 49699333)))
uses: ./.github/workflows/chromatic.yml
secrets: inherit
with:
pull_request_number: ${{ github.event.pull_request.number }}
Loading

0 comments on commit dc8283d

Please sign in to comment.