Skip to content

Commit

Permalink
ci: fix pr number
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Dec 29, 2023
1 parent 0982420 commit e70025b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jwalton/gh-find-current-pr@v1
id: findPr
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
Expand All @@ -22,7 +24,7 @@ jobs:
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.number }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}
- name: Build artifacts
run: ./scripts/ci/build-artifacts.sh
env:
Expand All @@ -47,14 +49,14 @@ jobs:
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.number }}
PR_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.GITHUB_TOKEN }}
PR: ${{ github.event.number }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}

test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion scripts/github/comment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const REPO = process.env.ACCESS_REPO;
const TOKEN = process.env.ACCESS_TOKEN;
const PR = process.env.PR;
const PR = process.env.PR_NUMBER;
const REPLACE_MARK = '<!-- AZURE_UPDATE_COMMENT -->';

const argv = process.argv;
Expand Down

0 comments on commit e70025b

Please sign in to comment.