generated from aetheric-oss/svc-template-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.71 KB
/
autosquash.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
## DO NOT EDIT!
# This file was provisioned by OpenTofu
# File origin: https://github.com/aetheric-oss/tofu-github/tree/main/src/modules/vars/templates/all/.github/workflows/autosquash.yml
---
name: Auto-squash
on:
pull_request:
branches:
- 'develop'
- 'main'
permissions:
contents: write
jobs:
autosquash:
name: Autosquash
runs-on: ubuntu-latest
steps:
- name: Import Aetheric bot's GPG key for signing commits
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.COMMITBOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.COMMITBOT_GPG_PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.COMMITBOT_GITHUB_TOKEN }}
fetch-depth: 0
- name: Automatic Rebase Autosquash
run: |
git rebase -i --autosquash origin/${{ github.base_ref }}
git push -f
env:
GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }}
GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }}
# git rebase with auto squash will be a noop if not run in interactive mode.
# using ':' or 'true' as the sequence editor allows us to automatically apply the squash actions
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-sequenceeditor
GIT_SEQUENCE_EDITOR: ':'