name: Linearize chapter history on: push: branches: - main jobs: linearize: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: ref: main fetch-depth: 0 # Fetch the full history - name: Construct linear history and push to linear branch run: | git config user.name 'GitHub Action' git config user.email 'actions@github.com' .github/workflows/linearize.sh git remote add linear ./linear git fetch linear git checkout -b linear linear/main git remote remove linear git push -f origin linear env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}