Skip to content

Commit

Permalink
fix workflow url when hosted remotely (fixes #55, fixes #56, via #57)
Browse files Browse the repository at this point in the history
  • Loading branch information
szczys authored Oct 14, 2024
1 parent 58e6590 commit a8d7257
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ Default ``
allure_history: allure-history
```

## Example usage (build to publish on different repo)

```yaml
- name: Test here and host elsewhere
uses: simple-elf/allure-report-action@master
if: always()
id: allure-report
with:
allure_results: build/allure-results
gh_pages: gh-pages
allure_report: allure-report
allure_history: allure-history
github_repo: your-org/allure-reports-host-server
github_repo_owner: your-org
```

## Finally you need to publish on GitHub Pages

```yaml
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ inputs:
description: 'GitHub repository owner'
required: true
default: ${{ github.repository_owner }}
github_tests_repo:
description: 'GitHub repository where test are run'
required: true
default: ${{ github.repository }}
report_url:
description: 'Use a custom URL instead of *.github.io'
required: false
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ echo "<meta http-equiv=\"Pragma\" content=\"no-cache\"><meta http-equiv=\"Expire
echo '{"name":"GitHub Actions","type":"github","reportName":"Allure Report with history",' > executor.json
echo "\"url\":\"${GITHUB_PAGES_WEBSITE_URL}\"," >> executor.json # ???
echo "\"reportUrl\":\"${GITHUB_PAGES_WEBSITE_URL}/${INPUT_GITHUB_RUN_NUM}/\"," >> executor.json
echo "\"buildUrl\":\"${INPUT_GITHUB_SERVER_URL}/${INPUT_GITHUB_REPO}/actions/runs/${INPUT_GITHUB_RUN_ID}\"," >> executor.json
echo "\"buildUrl\":\"${INPUT_GITHUB_SERVER_URL}/${INPUT_GITHUB_TESTS_REPO}/actions/runs/${INPUT_GITHUB_RUN_ID}\"," >> executor.json
echo "\"buildName\":\"GitHub Actions Run #${INPUT_GITHUB_RUN_ID}\",\"buildOrder\":\"${INPUT_GITHUB_RUN_NUM}\"}" >> executor.json
#cat executor.json
mv ./executor.json ./${INPUT_ALLURE_RESULTS}
Expand Down

0 comments on commit a8d7257

Please sign in to comment.