-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Build: Add NX check #33291
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
Build: Add NX check #33291
Changes from 1 commit
09e0a73
fb89ddc
adfdcc6
f096ff3
5517b86
6b85752
ef7c2da
9e2477c
66fc74c
18015cc
9327a32
b28a1e4
98732a1
44e7326
d3e8432
f6dff9b
1969a4c
ad127e9
db5aba0
c832292
73c3a8a
5491067
6a0da58
84169f2
4bedb0d
12e8ca3
d4be2f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -38,7 +38,27 @@ jobs: | |||
| - run: yarn install --immutable | ||||
| - uses: nrwl/nx-set-shas@v4 | ||||
|
|
||||
| # --- PRs --- | ||||
| # --- Create pending status at start for PRs --- | ||||
| - name: Create Nx Cloud Status (pending) | ||||
| if: github.event_name == 'pull_request' | ||||
| uses: actions/github-script@v7 | ||||
| with: | ||||
| script: | | ||||
| const prNumber = context.payload.pull_request.number; | ||||
| const nxCloudUrl = `https://cloud.nx.app/orgs/606dcb5cdc2a2b00059cc0e9/workspaces/6929fbef73e98d8094d2a343/overview?branch=${prNumber}`; | ||||
|
|
||||
| await github.rest.repos.createCommitStatus({ | ||||
| owner: context.repo.owner, | ||||
| repo: context.repo.repo, | ||||
| sha: context.payload.pull_request.head.sha, | ||||
| state: 'pending', | ||||
| avatar_url: 'https://avatars.githubusercontent.com/in/80458', | ||||
| target_url: nxCloudUrl, | ||||
| description: 'View Nx Cloud dashboard for this PR', | ||||
| context: 'Nx Cloud' | ||||
| }); | ||||
|
Comment on lines
67
to
77
|
||||
|
|
||||
| # --- PRs --- | ||||
| - if: github.event_name == 'pull_request' && | ||||
| contains(github.event.pull_request.labels.*.name, 'ci:normal') | ||||
| run: yarn nx run-many -t $ALL_TASKS -c production -p="tag:ci:normal" | ||||
|
|
@@ -53,3 +73,35 @@ jobs: | |||
| - if: github.event_name == 'push' && | ||||
| github.ref == 'refs/heads/next' | ||||
| run: yarn nx run-many -t $ALL_TASKS -c production -p="tag:ci:normal,tag:ci:merged" | ||||
|
|
||||
| # --- Final status update (success / failure / error) --- | ||||
| - name: Finalize Nx Cloud Status | ||||
| if: github.event_name == 'pull_request' && always() | ||||
| uses: actions/github-script@v7 | ||||
| with: | ||||
| script: | | ||||
| const prNumber = context.payload.pull_request.number; | ||||
| const nxCloudUrl = `https://cloud.nx.app/orgs/606dcb5cdc2a2b00059cc0e9/workspaces/6929fbef73e98d8094d2a343/overview?branch=${prNumber}`; | ||||
|
|
||||
| const jobStatus = '${{ job.status }}'; // 'success', 'failure', 'cancelled', 'skipped' | ||||
| /** Map job.status -> GitHub Statuses API state */ | ||||
| const stateMap = { | ||||
| success: 'success', | ||||
| failure: 'failure', | ||||
| cancelled: 'error', | ||||
| skipped: 'error' | ||||
| }; | ||||
| const state = stateMap[jobStatus] ?? 'error'; | ||||
|
|
||||
| await github.rest.repos.createCommitStatus({ | ||||
| owner: context.repo.owner, | ||||
| repo: context.repo.repo, | ||||
| sha: context.payload.pull_request.head.sha, | ||||
| state, | ||||
| avatar_url: 'https://avatars.githubusercontent.com/in/80458', | ||||
|
||||
| avatar_url: 'https://avatars.githubusercontent.com/in/80458', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
avatar_urlparameter is not a valid parameter for thecreateCommitStatusAPI. According to the GitHub API documentation, the valid parameters are:state,target_url,description, andcontext. Theavatar_urlparameter will be ignored.If you want to associate an avatar with the status, consider using a GitHub App instead of the commit status API, or remove this parameter as it has no effect.