File tree 4 files changed +37
-11
lines changed
4 files changed +37
-11
lines changed Original file line number Diff line number Diff line change @@ -127,14 +127,19 @@ jobs:
127
127
"install-awslocal": "true",
128
128
"configuration": "DEBUG=1",
129
129
"use-pro": "true",
130
+ "state-name": "cloud-pods-test",
131
+ "state-action": "load",
132
+ "state-backend": "local",
130
133
}
131
134
env :
132
135
LOCALSTACK_API_KEY : ${{ secrets.LOCALSTACK_API_KEY }}
133
136
GH_ACTION_VERSION : ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
134
137
135
138
- name : Run AWS Commands
136
139
run : |
140
+ awslocal s3 rb s3://test
137
141
awslocal s3 mb s3://test
142
+ awslocal sqs delete-queue --queue-url $(awslocal sqs get-queue-url --queue-name test-queue --output text)
138
143
awslocal sqs create-queue --queue-name test-queue
139
144
140
145
- name : Save the State Artifact
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ inputs:
50
50
skip-ephemeral-stop :
51
51
description : ' Skip stopping LocalStack Ephemeral Instance'
52
52
required : false
53
- default : ' false '
53
+ default : ' true '
54
54
state-action :
55
55
description : |
56
56
Manage LocalStack state
@@ -149,11 +149,11 @@ runs:
149
149
}
150
150
151
151
- name : Stop Ephemeral Instance
152
- if : ${{ ! inputs.skip-ephemeral-stop && inputs.state-action == 'stop' && inputs.state-backend == 'ephemeral' }}
152
+ if : ${{ ( inputs.skip-ephemeral-stop == 'false' || inputs.state-action == 'stop') && inputs.state-backend == 'ephemeral' }}
153
153
uses : jenseng/dynamic-uses@v1
154
154
with :
155
155
uses : ${{ env.GH_ACTION_ROOT }}/ephemeral/shutdown
156
156
with : |-
157
157
{
158
- "name ": ${{ toJSON(inputs.github-token) }},
158
+ "github-token ": ${{ toJSON(inputs.github-token) }},
159
159
}
Original file line number Diff line number Diff line change @@ -17,12 +17,24 @@ inputs:
17
17
runs :
18
18
using : composite
19
19
steps :
20
- - name : Download PR artifact
21
- uses : dawidd6/action-download-artifact@v2
20
+ # Try to get pr artifact from current workflow
21
+ - name : Download current PR artifact
22
+ id : get-pr-artifact
23
+ uses : actions/download-artifact@v3
24
+ continue-on-error : true
22
25
with :
23
- workflow : ${{ github.event.workflow_run.workflow_id }}
24
26
name : pr
25
27
28
+ # If the above fails, try to get the latest pr artifact from the PR related workflows
29
+ - name : Download latest PR artifact
30
+ uses : dawidd6/action-download-artifact@v6
31
+ if : ${{ steps.get-pr-artifact.outcome == 'failure' }}
32
+ with :
33
+ name : pr
34
+ pr : ${{ github.event.pull_request.number }}
35
+ # Can be ID or workflow file name, if empty falls back to the latest successful run of the current workflow
36
+ workflow : ${{ env.PR_ARTIFACT_WORKFLOW }}
37
+
26
38
- name : Load the PR ID
27
39
id : pr
28
40
shell : bash
Original file line number Diff line number Diff line change @@ -13,14 +13,23 @@ inputs:
13
13
runs :
14
14
using : " composite"
15
15
steps :
16
- - name : Download PR artifact
17
- uses : dawidd6/action-download-artifact@v2
16
+ # Try to get pr artifact from current workflow
17
+ - name : Download current workflow's Local State artifact
18
+ id : get-state-artifact
18
19
if : ${{ inputs.action == 'load' }}
19
- env :
20
- workflow_id : ${{ env.WORKFLOW_ID == '' && github.event.workflow_run.workflow_id || env.WORKFLOW_ID }}
20
+ uses : actions/download-artifact@v3
21
+ continue-on-error : true
22
+ with :
23
+ name : ${{ inputs.name }}
24
+
25
+ # If the above fails, try to get the latest artifact from given workflow
26
+ - name : Download latest Local State artifact
27
+ uses : dawidd6/action-download-artifact@v6
28
+ if : ${{ inputs.action == 'load' && steps.get-state-artifact.outcome == 'failure' }}
21
29
with :
22
- workflow :
23
30
name : ${{ inputs.name }}
31
+ workflow : ${{ env.LS_STATE_ARTIFACT_WORKFLOW }} # Can be ID or workflow file name, if empty falls back to the latest successful run of the current workflow
32
+ if_no_artifact_found : warn
24
33
25
34
- run : |
26
35
if [ "$ACTION" = "save" ]; then
You can’t perform that action at this time.
0 commit comments