Skip to content

Squash commits

Squash commits #5

Workflow file for this run

name: Squash commits
on:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"
jobs:
deploy:
name: Squash commits
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init repo
shell: bash
run: |
git config --local user.name "GitHub Action"
git config --local user.email "actions-user@users.noreply.github.com"
- name: Commit and push files
shell: bash
run: |
git reset --soft $(git log --grep 'THE HORiZON' | head -1 | sed 's|^commit *||')
git commit -m "$(date +%F)"
git push -f