11name : ' gitStream repo agent'
22description : ' Public GitHub action for gitStream Continuous Merge'
3-
43inputs :
54 full_repository :
65 description : ' Path of full Repository'
@@ -27,43 +26,27 @@ inputs:
2726 description : ' Run parser in debug mode'
2827 required : false
2928 default : false
30-
3129runs :
3230 using : ' composite'
3331 steps :
3432 - name : Set start time
3533 id : start
3634 run : echo "timestamp=$EPOCHSECONDS" >> $GITHUB_OUTPUT
3735 shell : bash
38-
39- - name : Cache gitstream folder
40- id : cache-gitstream
41- uses : actions/cache@v3
42- with :
43- path : gitstream
44- key : ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).repo }}-${{ github.event.inputs.head_ref }}-gitsream-cache
45-
4636 - name : Create GitStream folder
47- # # this step will be skipped if cache exists
48- if : ${{ steps.cache-gitstream.outputs.cache-hit != 'true' }}
4937 id : create-gitstream-folder
5038 shell : bash
5139 run : |
5240 mkdir gitstream
5341 cd gitstream
5442 mkdir repo
55- mkdir temp
56-
5743 - name : Checkout head branch
58- # # this step will be skipped if cache exists
5944 uses : actions/checkout@v3
60- if : ${{ steps.cache-gitstream.outputs.cache-hit != 'true' }}
6145 with :
6246 repository : ${{ inputs.full_repository }}
6347 ref : ${{ github.event.inputs.head_ref }}
6448 path : ' gitstream/repo/'
6549 token : ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).githubToken || github.token }}
66-
6750 - run : |
6851 all=2147483647
6952 cd gitstream
@@ -73,48 +56,19 @@ runs:
7356 git checkout ${{ github.event.inputs.head_ref }}
7457 git fetch --deepen=$all origin ${{ github.event.inputs.head_ref }}
7558 shell: bash
76- if: ${{ steps.cache-gitstream.outputs.cache-hit != 'true' }}
77-
78- - name : Update repo cache state
79- shell : bash
80- env :
81- GITHUB_TOKEN : ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).githubToken || github.token }}
82- run : |
83- cd gitstream && cd repo
84- git add . && git stash
85- git checkout ${{ github.event.inputs.base_ref }}
86- git add . && git stash && gh repo sync --force
87- git checkout ${{ github.event.inputs.head_ref }}
88- git add . && git stash && gh repo sync --force
89- if : ${{ steps.cache-gitstream.outputs.cache-hit == 'true' }}
90-
91- - name : Update cm cache state
92- shell : bash
93- env :
94- GITHUB_TOKEN : ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).githubToken || github.token }}
95- run : |
96- cd gitstream && cd cm
97- git add . && git stash && gh repo sync --force
98- if : ${{ steps.cache-gitstream.outputs.cache-hit == 'true' && fromJSON(fromJSON(github.event.inputs.client_payload)).hasCmRepo == true }}
99-
10059 - name : Create cm folder
101- # # this step will be skipped if cache exists
102- if : ${{ steps.cache-gitstream.outputs.cache-hit != 'true' }}
10360 id : create-cm-folder
10461 shell : bash
10562 run : |
10663 cd gitstream
10764 mkdir cm
108-
10965 - name : Checkout cm repo
11066 uses : actions/checkout@v3
111- # # this step will be skipped if cache exists AND has cm repo
112- if : ${{ steps.cache-gitstream.outputs.cache-hit != 'true' && fromJSON(fromJSON(github.event.inputs.client_payload)).hasCmRepo == true }}
67+ if : ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).hasCmRepo == true }}
11368 with :
11469 repository : ' ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).owner }}/${{ fromJSON(fromJSON(github.event.inputs.client_payload)).cmRepo }}'
11570 ref : ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).cmRepoRef }}
11671 path : ' gitstream/cm/'
117-
11872 - name : Run The Action
11973 id : gitstream-action
12074 if : always()
12680 docker run -v $(pwd)/gitstream:/code -e HEAD_REF=${{ github.event.inputs.head_ref }} -e BASE_REF=${{ github.event.inputs.base_ref }} -e CLIENT_PAYLOAD=${{ github.event.inputs.client_payload }} -e RULES_RESOLVER_URL=${{ github.event.inputs.resolver_url }} -e RULES_RESOLVER_TOKEN=${{ github.event.inputs.resolver_token }} -e DEBUG_MODE=${{ github.event.inputs.debug_mode }} gitstream/rules-engine
12781 echo "docker-run-duration=$SECONDS" >> $GITHUB_OUTPUT
12882 echo "action-run-duration=$(($EPOCHSECONDS - ${{ steps.start.outputs.timestamp }}))" >> $GITHUB_OUTPUT
129- shell : bash
83+ shell : bash
0 commit comments