Skip to content

Commit 41818ce

Browse files
committed
update workflow to correctly upload to directory for branch
1 parent 1e952bb commit 41818ce

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/actions/deploy-reports/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,22 @@ runs:
2828
- name: Set S3 prefix
2929
id: set-pages-dir
3030
run: |
31+
branch_ref="${{ github.head_ref || github.ref_name }}"
3132
sanitized_device=$(echo "${{ inputs.device }}" | tr -cd '[:alnum:]_-')
3233
timestamp=$(date -u +"%Y-%m-%d_%H-%M-%S")
33-
echo "dir=${{ github.head_ref }}/${{ inputs.environment }}/$sanitized_device/$timestamp" >> $GITHUB_OUTPUT
34+
echo "dir=$branch_ref/${{ inputs.environment }}/$sanitized_device/$timestamp" >> $GITHUB_OUTPUT
3435
shell: bash
3536

3637
- name: Upload report to S3
3738
run: |
3839
aws s3 sync \
3940
allure-report \
40-
s3://${{ inputs.s3-bucket }}${{ steps.set-pages-dir.outputs.dir }} \
41+
s3://${{ inputs.s3-bucket }}/${{ steps.set-pages-dir.outputs.dir }} \
4142
--delete
4243
shell: bash
4344

4445
- name: Set Job Summary
4546
run: |
46-
REPORT_URL="${{ inputs.report-base-url }}${{ steps.set-pages-dir.outputs.dir }}/index.html"
47+
REPORT_URL="${{ inputs.report-base-url }}/${{ steps.set-pages-dir.outputs.dir }}/index.html"
4748
echo "View test report: ${REPORT_URL}" >> "$GITHUB_STEP_SUMMARY"
4849
shell: bash

0 commit comments

Comments
 (0)