Skip to content

Commit a2ab438

Browse files
kmurphypolygonsshrihar
authored andcommitted
Fix for deployment issues to hosted/<branch>
1 parent 7c78c53 commit a2ab438

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

.github/workflows/build_and_deploy.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,31 @@ jobs:
6464
run: |
6565
changed_files=$(git diff --name-only HEAD^ HEAD)
6666
num_changed_files=$(echo "$changed_files" | wc -l)
67+
echo "Number of Files changed=$num_changed_files"
6768
echo "FILES_CHANGED=$num_changed_files" >> "$GITHUB_OUTPUT"
6869
6970
check_pr_open:
7071
runs-on: ubuntu-latest
7172
environment: ${{ inputs.environment }}
7273
needs: [check_files_changed]
73-
if: needs.check_files_changed.outputs.FILES_CHANGED != '' && startsWith(github.ref, 'refs/heads/hosted/')
74+
if: needs.check_files_changed.outputs.FILES_CHANGED != '' && startsWith(github.head_ref, 'hosted/')
7475
permissions:
7576
id-token: write
7677
contents: write
7778
outputs:
7879
PR_OPEN: ${{ steps.check_pr.outputs.PR_OPEN }}
7980
steps:
81+
- name: Checkout Code Repository
82+
uses: actions/checkout@v3
83+
with:
84+
fetch-depth: 1
85+
8086
- name: Check for open PR
8187
id: check_pr
8288
run: |
83-
BRANCH_NAME=$(echo "${GITHUB_REF}" | cut -d'/' -f4)
84-
pr_number=$(gh pr list --head "hosted/$BRANCH_NAME" --state open --json number --jq '.[0].number')
89+
BRANCH_NAME=${{ github.head_ref }}
90+
pr_number=$(gh pr list --head "$BRANCH_NAME" --state open --json number --jq '.[0].number')
91+
echo "Checked PR number: $pr_number"
8592
echo "PR_OPEN=$pr_number" >> "$GITHUB_OUTPUT"
8693
env:
8794
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -93,10 +100,11 @@ jobs:
93100
if: |
94101
needs.check_files_changed.outputs.FILES_CHANGED != '' && github.ref == 'refs/heads/dev' ||
95102
needs.check_pr_open.outputs.PR_OPEN != '' && needs.check_files_changed.outputs.FILES_CHANGED != '' &&
96-
startsWith(github.ref, 'refs/heads/hosted/')
103+
startsWith(github.head_ref, 'hosted/')
97104
permissions:
98105
id-token: write
99106
contents: write
107+
pull-requests: write
100108
steps:
101109
- uses: actions/setup-python@v4
102110
with:

.github/workflows/hosted-dev-deployment.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
name: Hosted PR and Dev Deployment
22
on:
33
pull_request:
4-
types: [opened, edited, reopened]
4+
types: [opened, edited, reopened, synchronize]
55
push:
66
branches:
77
- dev
8-
- hosted/**
98
workflow_dispatch:
109

1110
jobs:

build_branches.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,5 @@ def update_nginx_config(pr_numbers):
148148

149149
if __name__ == "__main__":
150150
current_dir = os.getcwd()
151-
pr_numbers = process_branch_folders()
152-
update_nginx_config(pr_numbers)
151+
open_prs = process_branch_folders()
152+
update_nginx_config(open_prs)

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ hide:
2222
<div class="section-wrapper">
2323
<div class="hero-content-flex">
2424
<div class="hero-left">
25-
<h1 class="hero-heading">The Polygon Knowledge Layer</h1>
25+
<h1 class="hero-heading">hosted/test-workflow 24 9 - correct branch name please</h1>
2626
<p class="hero-subtext">Welcome to the technical documentation and knowledge resources for Polygon protocols and scaling technologies.</p>
2727
<p class="hero-subtext"> Learn how to build and deploy dApps, launch ZK rollups and validiums as Layer 2s on Ethereum, spin up nodes, and find out about the latest in zero-knowledge research.</p>
2828
</div>

0 commit comments

Comments
 (0)