Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7b7bf92
add steps to fix pretty errors
Miodec Jan 22, 2025
9ca3b80
pretty mess up
Miodec Jan 22, 2025
73d0877
test
Miodec Jan 22, 2025
e03b6a6
test
Miodec Jan 22, 2025
a49ccd7
typo
Miodec Jan 22, 2025
1a2f9da
fix missing props
Miodec Jan 22, 2025
cc242b4
continue on error
Miodec Jan 22, 2025
7c68205
test
Miodec Jan 22, 2025
05fb12b
log
Miodec Jan 22, 2025
da383b9
test
Miodec Jan 22, 2025
a63e939
use outcome
Miodec Jan 22, 2025
6735d5a
commit
Miodec Jan 22, 2025
4682371
log2
Miodec Jan 22, 2025
fc17f2e
use outcome
Miodec Jan 22, 2025
481accf
remove log2
Miodec Jan 22, 2025
93a434a
permissions
Miodec Jan 22, 2025
76f4575
move perm
Miodec Jan 22, 2025
22d837c
Fix prettier
Miodec Jan 22, 2025
58d7511
remove log
Miodec Jan 22, 2025
b908cb7
commit message
Miodec Jan 22, 2025
469d745
wrong branch test
Miodec Jan 22, 2025
6a4c2e6
test
Miodec Jan 22, 2025
2d8845a
remove test
Miodec Jan 22, 2025
1b69a37
chore: prettier fixes
Miodec Jan 22, 2025
241fae5
move pretty check to a new job
Miodec Jan 23, 2025
c0c2b44
test
Miodec Jan 23, 2025
ed1eacd
fix dep
Miodec Jan 23, 2025
5c9e0c6
remmove name, change id
Miodec Jan 23, 2025
8377c51
add missing env
Miodec Jan 23, 2025
0baef1e
react on comment
Miodec Jan 23, 2025
6c451f5
update
Miodec Jan 23, 2025
c0330e2
rename
Miodec Jan 23, 2025
8586c59
remove label
Miodec Jan 23, 2025
5d686e3
running only on changed files
Miodec Jan 23, 2025
ccad83b
Merge branch 'master' into ci-pretty-fix
Miodec Jan 23, 2025
f747e82
prettier fix
Miodec Jan 23, 2025
52d31b7
test
Miodec Jan 23, 2025
fa779a3
prettier fix
Miodec Jan 23, 2025
64e5e8a
ci(pretty fix): use correct head ref
Miodec Jan 23, 2025
705a8b3
ci: use different action for removing label
Miodec Jan 23, 2025
c157fa8
ci: update permissions
Miodec Jan 23, 2025
4915919
ci: fix permission
Miodec Jan 23, 2025
3ccb4f6
add concurrency
Miodec Jan 27, 2025
ea0afca
block ci if workflow changed
Miodec Jan 27, 2025
6bfadb2
define perms
Miodec Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 10 additions & 54 deletions .github/workflows/monkey-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ jobs:
- 'packages/**/*'
anti-cheat:
- 'backend/**/anticheat/**'
workflows:
- '.github/workflows/**/*'

- name: Check Anti-cheat
if: steps.filter.outputs.anti-cheat == 'true'
run: exit 1

- name: Check Workflow Changes
if: steps.filter.outputs.workflows == 'true' && !contains(github.event.pull_request.labels.*.name, 'force-ci') && !contains(github.event.pull_request.labels.*.name, 'force-full-ci')
run: exit 1

- name: Export changes
id: export-changes
run: |
Expand Down Expand Up @@ -115,59 +121,9 @@ jobs:
name: Install dependencies
run: pnpm install

check-pretty:
name: check-pretty
needs: [pre-ci, prime-cache]
runs-on: ubuntu-latest
if: needs.pre-ci.outputs.should-build-be == 'true' || needs.pre-ci.outputs.should-build-fe == 'true' || needs.pre-ci.outputs.should-build-pkg == 'true' || needs.pre-ci.outputs.assets-json == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Install prettier
run: pnpm add -g [email protected]

- name: Get changed files
if: github.event_name == 'pull_request'
id: get-changed-files
uses: actions/github-script@v7
with:
script: |
const changedFiles = await github.paginate(
github.rest.pulls.listFiles,
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
}
);
return changedFiles.filter(file=> file.status !== "removed").map(file => file.filename).join(' ');

- name: Check pretty (changed files)
if: github.event_name == 'pull_request'
id: check-pretty
run: |
CHANGED_FILES=$(echo ${{ steps.get-changed-files.outputs.result }})
if [ -n "$CHANGED_FILES" ]; then
pnpm prettier --check $CHANGED_FILES
fi

- name: Check pretty (all files)
if: github.event_name == 'push'
run: pnpm prettier --check .

ci-be:
name: ci-be
needs: [pre-ci, prime-cache, check-pretty]
needs: [pre-ci, prime-cache]
runs-on: ubuntu-latest
if: needs.pre-ci.outputs.should-build-be == 'true' || needs.pre-ci.outputs.should-build-pkg == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
steps:
Expand Down Expand Up @@ -215,7 +171,7 @@ jobs:

ci-fe:
name: ci-fe
needs: [pre-ci, prime-cache, check-pretty]
needs: [pre-ci, prime-cache]
runs-on: ubuntu-latest
if: needs.pre-ci.outputs.should-build-fe == 'true' || needs.pre-ci.outputs.should-build-pkg == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
steps:
Expand Down Expand Up @@ -268,7 +224,7 @@ jobs:

ci-assets:
name: ci-assets
needs: [pre-ci, prime-cache, check-pretty]
needs: [pre-ci, prime-cache]
runs-on: ubuntu-latest
if: needs.pre-ci.outputs.assets-json == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
steps:
Expand Down Expand Up @@ -337,7 +293,7 @@ jobs:

ci-pkg:
name: ci-pkg
needs: [pre-ci, prime-cache,check-pretty]
needs: [pre-ci, prime-cache]
runs-on: ubuntu-latest
if: needs.pre-ci.outputs.should-build-pkg == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
steps:
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/pretty-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Prettier Check

env:
PNPM_VERSION: "9.6.0"
NODE_VERSION: "20.16.0"

on:
pull_request:
branches: [master]
types: [opened, reopened, synchronize, ready_for_review]

permissions:
contents: read

concurrency:
group: group-pretty-check-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
check:
if: github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'force-ci') || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
runs-on: ubuntu-latest

steps:
- name: Full checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Install prettier
run: pnpm add -g [email protected]

- name: Get changed files
id: get-changed-files
uses: actions/github-script@v7
with:
script: |
const changedFiles = await github.paginate(
github.rest.pulls.listFiles,
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
}
);
return changedFiles.filter(file=> file.status !== "removed").map(file => file.filename).join(' ');

- name: Check pretty (changed files)
run: |
CHANGED_FILES=$(echo ${{ steps.get-changed-files.outputs.result }})
if [ -n "$CHANGED_FILES" ]; then
pnpm prettier --check $CHANGED_FILES
fi

37 changes: 27 additions & 10 deletions .github/workflows/pretty-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ env:

permissions:
contents: write
pull-requests: write

on:
pull_request_target:
Expand All @@ -18,6 +19,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Set up Node.js
uses: actions/setup-node@v4
Expand All @@ -32,22 +35,36 @@ jobs:
- name: Install prettier
run: pnpm add -g [email protected]

- name: Get changed files
id: get-changed-files
uses: actions/github-script@v7
with:
script: |
const changedFiles = await github.paginate(
github.rest.pulls.listFiles,
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
}
);
return changedFiles.filter(file=> file.status !== "removed").map(file => file.filename).join(' ');


- name: Run Prettier fix
run: pnpm prettier --write .
run: |
CHANGED_FILES=$(echo ${{ steps.get-changed-files.outputs.result }})
if [ -n "$CHANGED_FILES" ]; then
pnpm prettier --write $CHANGED_FILES
fi

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "prettier fix"
branch: ${{ github.event.pull_request.head.ref }}

- name: Remove label
uses: actions/github-script@v7
uses: actions-ecosystem/action-remove-labels@v1
with:
script: |
const { context, github } = require('@actions/github');
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'prettify'
});
labels: prettify
Loading