Skip to content

Commit a8d7257

Browse files
authored
fix workflow url when hosted remotely (fixes #55, fixes #56, via #57)
1 parent 58e6590 commit a8d7257

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,22 @@ Default ``
7676
allure_history: allure-history
7777
```
7878

79+
## Example usage (build to publish on different repo)
80+
81+
```yaml
82+
- name: Test here and host elsewhere
83+
uses: simple-elf/allure-report-action@master
84+
if: always()
85+
id: allure-report
86+
with:
87+
allure_results: build/allure-results
88+
gh_pages: gh-pages
89+
allure_report: allure-report
90+
allure_history: allure-history
91+
github_repo: your-org/allure-reports-host-server
92+
github_repo_owner: your-org
93+
```
94+
7995
## Finally you need to publish on GitHub Pages
8096

8197
```yaml

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ inputs:
4545
description: 'GitHub repository owner'
4646
required: true
4747
default: ${{ github.repository_owner }}
48+
github_tests_repo:
49+
description: 'GitHub repository where test are run'
50+
required: true
51+
default: ${{ github.repository }}
4852
report_url:
4953
description: 'Use a custom URL instead of *.github.io'
5054
required: false

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ echo "<meta http-equiv=\"Pragma\" content=\"no-cache\"><meta http-equiv=\"Expire
4848
echo '{"name":"GitHub Actions","type":"github","reportName":"Allure Report with history",' > executor.json
4949
echo "\"url\":\"${GITHUB_PAGES_WEBSITE_URL}\"," >> executor.json # ???
5050
echo "\"reportUrl\":\"${GITHUB_PAGES_WEBSITE_URL}/${INPUT_GITHUB_RUN_NUM}/\"," >> executor.json
51-
echo "\"buildUrl\":\"${INPUT_GITHUB_SERVER_URL}/${INPUT_GITHUB_REPO}/actions/runs/${INPUT_GITHUB_RUN_ID}\"," >> executor.json
51+
echo "\"buildUrl\":\"${INPUT_GITHUB_SERVER_URL}/${INPUT_GITHUB_TESTS_REPO}/actions/runs/${INPUT_GITHUB_RUN_ID}\"," >> executor.json
5252
echo "\"buildName\":\"GitHub Actions Run #${INPUT_GITHUB_RUN_ID}\",\"buildOrder\":\"${INPUT_GITHUB_RUN_NUM}\"}" >> executor.json
5353
#cat executor.json
5454
mv ./executor.json ./${INPUT_ALLURE_RESULTS}

0 commit comments

Comments
 (0)