Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix pr number #1763

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.CI_TOKEN }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}
PR_NUMBER: ${{ github.event.number ?? steps.findPr.outputs.pr }}
- uses: actions/cache@v3
with:
path: ./node_modules
Expand All @@ -35,7 +35,7 @@ jobs:
run: yarn run site:build
- name: 'Deploy Site'
run: |
export DEPLOY_DOMAIN=https://preview-${{ steps.findPr.outputs.pr }}-ng-alain-delon.surge.sh
export DEPLOY_DOMAIN=https://preview-${{ github.event.number ?? steps.findPr.outputs.pr }}-ng-alain-delon.surge.sh
echo "Deploy to $DEPLOY_DOMAIN"
cp ./src/dist/browser/index.html ./src/dist/browser/404.html
npx surge --project ./src/dist/browser --domain $DEPLOY_DOMAIN
Expand All @@ -46,19 +46,19 @@ jobs:
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
- name: 'Update comment on github'
run: |
export DEPLOY_DOMAIN=https://preview-${{ steps.findPr.outputs.pr }}-ng-alain-delon.surge.sh
export DEPLOY_DOMAIN=https://preview-${{ github.event.number ?? steps.findPr.outputs.pr }}-ng-alain-delon.surge.sh
node ./scripts/github/comment.js "[Preview is ready!]($DEPLOY_DOMAIN)"
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.CI_TOKEN }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}
PR_NUMBER: ${{ github.event.number ?? steps.findPr.outputs.pr }}
- name: 'When failed'
if: failure()
run: node ./scripts/github/comment.js "[Preview Build Failed!](https://github.com/ng-alain/delon/actions/runs/${{ github.run_id }})"
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.CI_TOKEN }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}
PR_NUMBER: ${{ github.event.number ?? steps.findPr.outputs.pr }}

test:
runs-on: ubuntu-latest
Expand Down