File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
playwright-gh-pages/deploy-report-pages Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,25 @@ runs:
8888 comment-tag : gf-playwright-test-results
8989 message : ${{ steps.generate-table.outputs.table }}
9090
91+ - name : Validate pages branch safety
92+ shell : bash
93+ run : |
94+ if [[ "$PAGES_BRANCH" == "main" || "$PAGES_BRANCH" == "master" ]]; then
95+ echo "ERROR: Cannot deploy to main/master branch"
96+ echo "Please use a dedicated branch like 'gh-pages' for Pages deployment."
97+ exit 1
98+ fi
99+ env :
100+ PAGES_BRANCH : ${{ inputs.pages-branch }}
101+
91102 - name : Push the new files to github pages
92103 uses : peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
93104 with :
94105 publish_branch : ${{ inputs.pages-branch }}
95106 github_token : ${{ inputs.github-token }}
96107 publish_dir : all-reports
97108 destination_dir : ${{ steps.timestampid.outputs.timestamp }}/${{ steps.set-initiator.outputs.job_initiator }}
109+ force_orphan : true
98110
99111
100112 - name : Checkout code
@@ -119,7 +131,7 @@ runs:
119131 echo "No changes to commit"
120132 else
121133 git commit -m "Delete folders older than $RETENTION_DAYS days"
122- git push origin $PAGES_BRANCH
134+ git push -f origin $PAGES_BRANCH
123135 fi
124136 env :
125137 RETENTION_DAYS : ${{ inputs.retention-days }}
You can’t perform that action at this time.
0 commit comments