-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 1.47 KB
/
alignment.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
name: Alignment
on:
repository_dispatch:
types: [alignment]
jobs:
alignment:
runs-on: ubuntu-latest
steps:
- name: Create GitHub App Token
uses: actions/[email protected]
id: generate-token
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
- uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive
fetch-depth: 0
- run: |
git config --global user.name "DemyCode"
git config --global user.email "[email protected]"
git checkout -b ${{ github.event.client_payload.branch }} || git checkout ${{ github.event.client_payload.branch }}
cd ${{ github.event.client_payload.repository }}
git checkout origin/${{ github.event.client_payload.branch }}
cd ..
git add ${{ github.event.client_payload.repository }}
COMMIT_MESSAGE="${{ github.event.client_payload.message }}"
if [ ${{ startsWith(github.event.client_payload.message, 'chore(release):') }} = true ]; then
COMMIT_MESSAGE=${COMMIT_MESSAGE/release/${{ github.event.client_payload.repository }}}
fi
git commit -m "${COMMIT_MESSAGE}"
git push origin ${{ github.event.client_payload.branch }} || git push --set-upstream origin ${{ github.event.client_payload.branch }} || echo "Push failed. See previous logs for details."