47
47
steps :
48
48
- name : Checkout
49
49
uses : actions/checkout@v2
50
- with :
51
- ref : ${{ github.ref }}
52
50
53
51
- name : Check if PR is open
54
52
id : check_pr
@@ -70,14 +68,18 @@ jobs:
70
68
PR_NUMBER : ${{ steps.pr_info.outputs.PR_NUMBER }}
71
69
PR_TITLE : ${{ steps.pr_info.outputs.PR_TITLE }}
72
70
PR_URL : ${{ steps.pr_info.outputs.PR_URL }}
73
- PR_BRANCH : ${{ steps.pr_info.outputs.PR_BRANCH }}
74
71
CODER_BASE_IMAGE_TAG : ${{ steps.set_tags.outputs.CODER_BASE_IMAGE_TAG }}
75
72
CODER_IMAGE_TAG : ${{ steps.set_tags.outputs.CODER_IMAGE_TAG }}
76
73
NEW : ${{ steps.check_deployment.outputs.new }}
77
74
BUILD : ${{ steps.filter.outputs.all_count > steps.filter.outputs.ignored_count || steps.check_deployment.outputs.new }}
78
75
79
76
runs-on : " ubuntu-latest"
80
77
steps :
78
+ - name : Checkout
79
+ uses : actions/checkout@v3
80
+ with :
81
+ fetch-depth : 0
82
+
81
83
- name : Get PR number, title, and branch name
82
84
id : pr_info
83
85
run : |
88
90
echo "PR_URL=$PR_URL" >> $GITHUB_OUTPUT
89
91
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT
90
92
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_OUTPUT
91
- echo "PR_BRANCH=$PR_BRANCH" >> $GITHUB_OUTPUT
93
+
92
94
env :
93
95
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
94
- PR_BRANCH : ${${{ github.ref}}#refs/heads/}
95
96
96
97
- name : Set required tags
97
98
id : set_tags
@@ -148,19 +149,12 @@ jobs:
148
149
reactions : eyes
149
150
reactions-edit-mode : replace
150
151
151
- - name : Checkout
152
- if : github.event_name == 'workflow_dispatch' || steps.check_deployment.outputs.NEW == 'false'
153
- uses : actions/checkout@v3
154
- with :
155
- ref : ${{ steps.pr_info.outputs.PR_BRANCH }}
156
- fetch-depth : 0
157
-
158
152
- name : Check changed files
159
153
if : github.event_name == 'workflow_dispatch' || steps.check_deployment.outputs.NEW == 'false'
160
154
uses : dorny/paths-filter@v2
161
155
id : filter
162
156
with :
163
- base : ${{ steps.pr_info.outputs.PR_BRANCH }}
157
+ base : ${{ github.ref }}
164
158
filters : |
165
159
all:
166
160
- "**"
@@ -195,13 +189,10 @@ jobs:
195
189
env :
196
190
DOCKER_CLI_EXPERIMENTAL : " enabled"
197
191
CODER_IMAGE_TAG : ${{ needs.get_info.outputs.CODER_IMAGE_TAG }}
198
- PR_NUMBER : ${{ needs.get_info.outputs.PR_NUMBER }}
199
- PR_BRANCH : ${{ needs.get_info.outputs.PR_BRANCH }}
200
192
steps :
201
193
- name : Checkout
202
194
uses : actions/checkout@v3
203
195
with :
204
- ref : ${{ env.PR_BRANCH }}
205
196
fetch-depth : 0
206
197
207
198
- name : Setup Node
@@ -248,7 +239,6 @@ jobs:
248
239
PR_NUMBER : ${{ needs.get_info.outputs.PR_NUMBER }}
249
240
PR_TITLE : ${{ needs.get_info.outputs.PR_TITLE }}
250
241
PR_URL : ${{ needs.get_info.outputs.PR_URL }}
251
- PR_BRANCH : ${{ needs.get_info.outputs.PR_BRANCH }}
252
242
PR_HOSTNAME : " pr${{ needs.get_info.outputs.PR_NUMBER }}.${{ secrets.PR_DEPLOYMENTS_DOMAIN }}"
253
243
steps :
254
244
- name : Set up kubeconfig
@@ -279,8 +269,6 @@ jobs:
279
269
280
270
- name : Checkout
281
271
uses : actions/checkout@v3
282
- with :
283
- ref : ${{ env.PR_BRANCH }}
284
272
285
273
- name : Create PR namespace
286
274
if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.deploy == 'true'
0 commit comments