1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/.github/workflows/gitar-duet-action.yml
Gautam Korlam 77ea596c78
[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
2024-09-16 19:35:06 +03:00

52 lines
1.2 KiB
YAML

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 }}