Skip to content

Commit 9f98baf

Browse files
Merge pull request #1377 from oleksandr-pavlyk/fix-fork-workflows
Fix fork workflows
2 parents 0a3888c + e06bf40 commit 9f98baf

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/conda-package.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,11 @@ jobs:
608608
echo "Array API standard conformance tests failed to run for dpctl=$PACKAGE_VERSION."
609609
exit 1
610610
fi
611+
- name: Output API summary
612+
shell: bash -l {0}
613+
run: echo "::notice ${{ env.MESSAGE }}"
611614
- name: Post result to PR
615+
if: ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork }}
612616
uses: mshick/add-pr-comment@v1
613617
with:
614618
message: |

.github/workflows/generate-docs.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
mv ../cmake-install/docs/docs ~/docs
7777
git clean -dfx
7878
- name: Publish docs
79-
if: ${{ github.ref == 'refs/heads/master' }}
79+
if: ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork && github.ref == 'refs/heads/master' }}
8080
shell: bash -l {0}
8181
run: |
8282
git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/dpctl.git
@@ -91,8 +91,15 @@ jobs:
9191
git config --global user.email 'github-actions[doc-deploy-bot]@users.noreply.github.com'
9292
git commit -m "Latest docs."
9393
git push tokened_docs gh-pages
94+
- name: Save built docs as an artifact
95+
if: ${{ github.event.pull_request && github.event.pull_request.head.repo.fork && github.event.action != 'closed'}}
96+
uses: actions/upload-artifact@v3
97+
with:
98+
name: ${{ env.PACKAGE_NAME }} rendered documentation
99+
path: ~/docs
100+
94101
- name: Publish pull-request docs
95-
if: ${{ github.event.pull_request && github.event.action != 'closed' }}
102+
if: ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed' }}
96103
env:
97104
PR_NUM: ${{ github.event.number }}
98105
shell: bash -l {0}
@@ -111,7 +118,7 @@ jobs:
111118
git commit -m "Docs for pull request ${PR_NUM}"
112119
git push tokened_docs gh-pages
113120
- name: Unpublish pull-request docs
114-
if: ${{ github.event.pull_request && github.event.action == 'closed' }}
121+
if: ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action == 'closed' }}
115122
env:
116123
PR_NUM: ${{ github.event.number }}
117124
shell: bash -l {0}
@@ -128,7 +135,7 @@ jobs:
128135
git commit -m "Removing docs for closed pull request ${PR_NUM}"
129136
git push tokened_docs gh-pages
130137
- name: Comment with URL to published pull-request docs
131-
if: ${{ github.event.pull_request && github.event.action != 'closed' }}
138+
if: ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed' }}
132139
env:
133140
PR_NUM: ${{ github.event.number }}
134141
uses: mshick/add-pr-comment@v1
@@ -138,7 +145,7 @@ jobs:
138145
repo-token: ${{ secrets.GITHUB_TOKEN }}
139146
repo-token-user-login: 'github-actions[bot]'
140147
- name: Comment with URL about removal of PR docs
141-
if: ${{ github.event.pull_request && github.event.action == 'closed' }}
148+
if: ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action == 'closed' }}
142149
env:
143150
PR_NUM: ${{ github.event.number }}
144151
uses: mshick/add-pr-comment@v1

0 commit comments

Comments
 (0)