-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
51 lines (49 loc) · 1.66 KB
/
action.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
name: "Update Component"
description: "Downloads the parts of a component's architecture documentation, combines them and updates the existing file."
inputs:
component-id:
description: "The ID of the component."
required: true
github-token:
description: "A GitHub token that can be used to write to the repositories content."
required: true
runs:
using: composite
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
repository: automatic-architecture-documentation/documentation
token: ${{ inputs.github-token }}
- name: "Setup Java"
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: "Setup Gradle"
uses: gradle/gradle-build-action@v3
with:
gradle-version: wrapper
- name: "Download Architecture Documentation Parts"
uses: actions/download-artifact@v4
with:
name: architecture-documentation-parts
path: .build/tmp/parts
- name: "Setup Gradle Wrapper"
working-directory: .build
shell: bash
run: chmod +x ./gradlew
- name: "Combine Parts"
working-directory: .build
shell: bash
run: './gradlew --no-daemon combineParts -PcomponentId=${{ inputs.component-id }}'
- name: "Commit & Push Changes"
shell: bash
run: |
git config --global user.name "Botty"
git config --global user.email "[email protected]"
git add .build/src/json/components/${{ inputs.component-id }}.json
git diff --quiet --exit-code --cached || {
git commit -m "updated ${{ inputs.component-id }}.json"
git push origin HEAD:master
}