mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
[Gitar] Apply gitar duet on top of gitar bot PRs (#8141)
<!-- Thanks for creating a PR! To make it easier for reviewers and everyone else to understand what your changes relate to, please add some relevant content to the headings below. Feel free to ignore or delete sections that you don't think are relevant. Thank you! ❤️ --> ## About the changes When working with automated changes made by the @gitar-bot , custom automated changes may be necessary. For example, - Running lint auto-fixes - Executing code generation - Updating test snapshot files - Running internal tools Gitar recommends these in a separate CI pipeline. We call this [Gitar Duet](https://gitar.co/docs/more/custom-automated-changes/), where custom tools run alongside Gitar’s automated changes. ### Important files github ci workflow files ## Discussion points Feel free to update the workflow to modify the autofix steps
This commit is contained in:
parent
85522e097c
commit
77ea596c78
51
.github/workflows/gitar-duet-action.yml
vendored
Normal file
51
.github/workflows/gitar-duet-action.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
name: Gitar Duet
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'gitar_*'
|
||||
|
||||
jobs:
|
||||
gitar-duet:
|
||||
if: github.event.head_commit.author.name == 'Gitar'
|
||||
runs-on: ubuntu-latest
|
||||
name: Gitar Duet
|
||||
permissions:
|
||||
contents: write # Required to update with Gitar Duet changes
|
||||
|
||||
steps:
|
||||
- run: |
|
||||
echo '${{ toJSON(github.event) }}'
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Use Node.js 20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Enable corepack
|
||||
run: corepack enable
|
||||
|
||||
- run: yarn install --immutable
|
||||
env:
|
||||
YARN_ENABLE_SCRIPTS: false
|
||||
|
||||
- run: |
|
||||
yarn run biome check --fix --unsafe || true # Run unsafe auto-fixes
|
||||
yarn lint:fix || true # Fix linting issues
|
||||
|
||||
- run: yarn test:updateSnapshot || true # Update test snapshots
|
||||
|
||||
- run: |
|
||||
# Undo deletes for snapshots
|
||||
git reset
|
||||
git diff --diff-filter=D --name-only HEAD | xargs git checkout HEAD^ --
|
||||
|
||||
- name: Run Gitar Duet Action
|
||||
uses: gitarcode/gitar-duet-action@v1
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
@ -58,6 +58,7 @@
|
||||
"test:watch": "yarn test --watch",
|
||||
"test:coverage": "NODE_ENV=test PORT=4243 jest --coverage --testLocationInResults --outputFile=\"coverage/report.json\" --forceExit --testTimeout=10000",
|
||||
"test:coverage:jest": "NODE_ENV=test PORT=4243 jest --silent --ci --json --coverage --testLocationInResults --outputFile=\"report.json\" --forceExit --testTimeout=10000",
|
||||
"test:updateSnapshot": "NODE_ENV=test PORT=4243 jest --updateSnapshot --testTimeout=10000",
|
||||
"seed:setup": "ts-node --compilerOptions '{\"strictNullChecks\": false}' src/test/e2e/seed/segment.seed.ts",
|
||||
"seed:serve": "UNLEASH_DATABASE_NAME=unleash_test UNLEASH_DATABASE_SCHEMA=seed yarn run start:dev",
|
||||
"clean": "del-cli --force dist",
|
||||
@ -247,4 +248,4 @@
|
||||
]
|
||||
},
|
||||
"packageManager": "yarn@4.4.1"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user