Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion playwright-gh-pages/deploy-report-pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,25 @@ runs:
comment-tag: gf-playwright-test-results
message: ${{ steps.generate-table.outputs.table }}

- name: Validate pages branch safety
shell: bash
run: |
if [[ "$PAGES_BRANCH" == "main" || "$PAGES_BRANCH" == "master" ]]; then
echo "ERROR: Cannot deploy to main/master branch"
echo "Please use a dedicated branch like 'gh-pages' for Pages deployment."
exit 1
fi
env:
PAGES_BRANCH: ${{ inputs.pages-branch }}

- name: Push the new files to github pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
publish_branch: ${{ inputs.pages-branch }}
github_token: ${{ inputs.github-token }}
publish_dir: all-reports
destination_dir: ${{ steps.timestampid.outputs.timestamp }}/${{ steps.set-initiator.outputs.job_initiator }}
force_orphan: true


- name: Checkout code
Expand All @@ -119,7 +131,7 @@ runs:
echo "No changes to commit"
else
git commit -m "Delete folders older than $RETENTION_DAYS days"
git push origin $PAGES_BRANCH
git push -f origin $PAGES_BRANCH
fi
env:
RETENTION_DAYS: ${{ inputs.retention-days }}
Expand Down