1
+ # This configuration is used for the pull request review
1
2
name : review
2
3
3
4
on :
4
5
pull_request :
6
+ # Runs only on pull request creation and on every new commit to the created pull request
5
7
types : [opened, synchronize]
6
8
7
9
jobs :
@@ -10,24 +12,33 @@ jobs:
10
12
runs-on : ubuntu-latest
11
13
12
14
steps :
15
+ # Cancels previous run for this branch that have a different commit id (SHA)
16
+ - name : cancel-previous-run
17
+
18
+ with :
19
+ access_token : ${{ github.token }}
20
+
21
+ # Checkout the git repository
13
22
- name : checkout
14
23
uses : actions/checkout@v2
15
24
with :
16
25
ref : ${{ github.head_ref }}
17
26
token : ${{ secrets.GPR_TOKEN }}
18
27
fetch-depth : ' '
19
28
29
+ # Execute some necessary git commands to get more repository informations
20
30
- name : post-checkout
21
31
run : git fetch --prune --unshallow
22
32
33
+ # Update GitHub Action configuration if necessary
23
34
- name : action-configuration-autoupdate
24
- id : actions_action_configuration_autoupdate
25
35
uses : avides/actions-action-configuration-autoupdate@v1
26
36
with :
27
37
token : ${{ secrets.GPR_TOKEN }}
28
38
actions-configuration-files : plain-docker-application/nightly.yml,plain-docker-application/release.yml,plain-docker-application/review.yml
29
39
source-repository : ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_REPO }}
30
40
41
+ # Push updated GitHub Actions configuration if necessary
31
42
- uses : stefanzweifel/git-auto-commit-action@v4
32
43
with :
33
44
file_pattern : .github/workflows/*.yml
@@ -36,17 +47,34 @@ jobs:
36
47
commit_author : ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_AUTHOR }}
37
48
commit_message : Update GitHub Action configuration
38
49
39
- - name : action-configuration-updated
40
- if : ${{ steps.actions_action_configuration_autoupdate.outputs.updated }}
41
- run : exit 1;
42
-
50
+ # Verify project version is updated
43
51
- name : project-version-check
44
52
id : project_version_check
45
53
uses : avides/actions-project-version-check@v1
46
54
with :
47
55
token : ${{ secrets.GITHUB_TOKEN }}
48
56
file-to-check : version.txt
49
57
58
+ # Check if documentation reminder comment is already given
59
+ - name : find-documentation-reminder-comment
60
+ uses : peter-evans/find-comment@v1
61
+ id : find_documentation_reminder_comment
62
+ with :
63
+ issue-number : ${{ github.event.number }}
64
+ body-includes : " Confluence/GitHub documentation added or updated?"
65
+
66
+ # Add documentation reminder comment if not given
67
+ - name : documentation-reminder-comment
68
+ uses : jungwinter/comment@v1
69
+ id : create
70
+ if : ${{ steps.find_documentation_reminder_comment.outputs.comment-id == 0 }}
71
+ with :
72
+ type : create
73
+ body : ' Confluence/GitHub documentation added or updated?'
74
+ issue_number : ${{ github.event.number }}
75
+ token : ${{ secrets.GITHUB_TOKEN }}
76
+
77
+ # Build docker image
50
78
- name : build-image
51
79
env :
52
80
PROJECT_VERSION : ${{ steps.project_version_check.outputs.version }}
0 commit comments