Skip CNAME on forks #545
Answered
by
peaceiris
friederbluemle
asked this question in
Q&A
-
Thanks for this action. Is there a way to skip creating the CNAME file on forks only? The deployment will fail for forks since the domain is already taken by the source repo. I don't want to use a CNAME for forks, the default location as generated by GitHub is fine. Is there a recommended CNAME strategy to allow this action to run on both source and forked repos? |
Beta Was this translation helpful? Give feedback.
Answered by
peaceiris
Dec 10, 2020
Replies: 1 comment 1 reply
-
Suggestion 1Skip deployment on forks. - name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.event.repository.fork == false
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
cname: peaceiris.com Suggestion 2Set - name: Set CNAME
id: cname
run: |
if [ ${{ github.event.repository.fork }} = 'false' ]; then
echo "::set-output name=cname::peaceiris.com"
fi
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
cname: ${{ steps.cname.outputs.cname }} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
friederbluemle
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suggestion 1
Skip deployment on forks.
Suggestion 2
Set
cname
to empty on forks.