-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (43 loc) · 1.71 KB
/
transifex-conventional-rebase.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
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Transifex conventional commits
on:
pull_request:
types: [opened, ready_for_review, reopened, synchronize]
permissions:
contents: read
concurrency:
group: transifex-conventional-rebase-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
transifex-conventional-rebase:
name: Rebase transifex PR with conventional commits
if: github.event.pull_request.user.login == 'transifex-integration[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
token: ${{ secrets.COMMAND_BOT_PAT }}
ref: ${{ github.head_ref }}
- uses: webiny/action-conventional-commits@8bc41ff4e7d423d56fa4905f6ff79209a78776c7 # v1.3.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup git
if: failure()
run: |
git config --local user.email 'nextcloud-command@users.noreply.github.com'
git config --local user.name 'nextcloud-command'
- name: Rebase on failure
if: failure()
run: |
git fetch origin '${{ github.base_ref }}:${{ github.base_ref }}'
git rebase --exec 'git commit --amend --no-verify -m "chore(l10n): $(git show -s --format=%s)"' 'HEAD~${{ github.event.pull_request.commits }}'
git push --force --set-upstream origin ${{ github.head_ref }}
# We already have the block-unconventional-commits action to fail if necessary
- name: Success
if: always()
run: |
echo "Success"
exit 0