Skip to content

Commit 62bcb8e

Browse files
committed
remove BRANCH NAME
1 parent 4f5abfd commit 62bcb8e

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

.github/workflows/pr-deploy.yaml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ jobs:
4747
steps:
4848
- name: Checkout
4949
uses: actions/checkout@v2
50-
with:
51-
ref: ${{ github.ref }}
5250

5351
- name: Check if PR is open
5452
id: check_pr
@@ -70,14 +68,18 @@ jobs:
7068
PR_NUMBER: ${{ steps.pr_info.outputs.PR_NUMBER }}
7169
PR_TITLE: ${{ steps.pr_info.outputs.PR_TITLE }}
7270
PR_URL: ${{ steps.pr_info.outputs.PR_URL }}
73-
PR_BRANCH: ${{ steps.pr_info.outputs.PR_BRANCH }}
7471
CODER_BASE_IMAGE_TAG: ${{ steps.set_tags.outputs.CODER_BASE_IMAGE_TAG }}
7572
CODER_IMAGE_TAG: ${{ steps.set_tags.outputs.CODER_IMAGE_TAG }}
7673
NEW: ${{ steps.check_deployment.outputs.new }}
7774
BUILD: ${{ steps.filter.outputs.all_count > steps.filter.outputs.ignored_count || steps.check_deployment.outputs.new }}
7875

7976
runs-on: "ubuntu-latest"
8077
steps:
78+
- name: Checkout
79+
uses: actions/checkout@v3
80+
with:
81+
fetch-depth: 0
82+
8183
- name: Get PR number, title, and branch name
8284
id: pr_info
8385
run: |
@@ -88,10 +90,9 @@ jobs:
8890
echo "PR_URL=$PR_URL" >> $GITHUB_OUTPUT
8991
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT
9092
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_OUTPUT
91-
echo "PR_BRANCH=$PR_BRANCH" >> $GITHUB_OUTPUT
93+
9294
env:
9395
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
PR_BRANCH: ${${{ github.ref}}#refs/heads/}
9596

9697
- name: Set required tags
9798
id: set_tags
@@ -148,19 +149,12 @@ jobs:
148149
reactions: eyes
149150
reactions-edit-mode: replace
150151

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-
158152
- name: Check changed files
159153
if: github.event_name == 'workflow_dispatch' || steps.check_deployment.outputs.NEW == 'false'
160154
uses: dorny/paths-filter@v2
161155
id: filter
162156
with:
163-
base: ${{ steps.pr_info.outputs.PR_BRANCH }}
157+
base: ${{ github.ref }}
164158
filters: |
165159
all:
166160
- "**"
@@ -195,13 +189,10 @@ jobs:
195189
env:
196190
DOCKER_CLI_EXPERIMENTAL: "enabled"
197191
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 }}
200192
steps:
201193
- name: Checkout
202194
uses: actions/checkout@v3
203195
with:
204-
ref: ${{ env.PR_BRANCH }}
205196
fetch-depth: 0
206197

207198
- name: Setup Node
@@ -248,7 +239,6 @@ jobs:
248239
PR_NUMBER: ${{ needs.get_info.outputs.PR_NUMBER }}
249240
PR_TITLE: ${{ needs.get_info.outputs.PR_TITLE }}
250241
PR_URL: ${{ needs.get_info.outputs.PR_URL }}
251-
PR_BRANCH: ${{ needs.get_info.outputs.PR_BRANCH }}
252242
PR_HOSTNAME: "pr${{ needs.get_info.outputs.PR_NUMBER }}.${{ secrets.PR_DEPLOYMENTS_DOMAIN }}"
253243
steps:
254244
- name: Set up kubeconfig
@@ -279,8 +269,6 @@ jobs:
279269
280270
- name: Checkout
281271
uses: actions/checkout@v3
282-
with:
283-
ref: ${{ env.PR_BRANCH }}
284272

285273
- name: Create PR namespace
286274
if: needs.get_info.outputs.NEW == 'true' || github.event.inputs.deploy == 'true'

0 commit comments

Comments
 (0)