PR status 5653 - 0a6114806cb7646a5171b7eb0df50ba72f7873da - nvfuser-ci/jit_binary_tests_20_GB200_1/3 #141349
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES. | |
| # All rights reserved. | |
| # SPDX-License-Identifier: BSD-3-Clause | |
| # see https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status | |
| name: Nvfuser-CI Logs v2 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| state: | |
| description: 'job status' | |
| required: true | |
| descr: | |
| description: 'description of the job' | |
| required: true | |
| commit_sha: | |
| description: 'SHA of the commit that was tested.' | |
| required: true | |
| target_url: | |
| description: 'target url' | |
| required: true | |
| context: | |
| description: 'context' | |
| required: true | |
| pr_number: | |
| description: 'pr number' | |
| required: true | |
| run-name: PR status ${{ inputs.pr_number }} - ${{ inputs.commit_sha }} - ${{ inputs.context }} | |
| jobs: | |
| status_update: | |
| name: Update commit status | |
| runs-on: ubuntu-latest | |
| permissions: | |
| statuses: write | |
| contents: write | |
| pull-requests: read | |
| steps: | |
| - name: Set status | |
| run: | | |
| curl -L -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| https://api.github.com/repos/${{ github.repository }}/statuses/${{ inputs.commit_sha }} \ | |
| -d "{ \ | |
| \"state\":\"${{ inputs.state }}\", \ | |
| \"target_url\":\"${{ inputs.target_url }}\", \ | |
| \"description\":\"${{ inputs.descr }}\", \ | |
| \"context\":\"${{ inputs.context }}\" \ | |
| }" | |
| - name: Trigger auto-merge check | |
| if: inputs.context == 'nvfuser-ci' && inputs.state == 'success' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| // Check if PR has enable-auto-merge label | |
| const { data: pr } = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: ${{ inputs.pr_number }}, | |
| }); | |
| const hasLabel = pr.labels.some(label => label.name === 'enable-auto-merge'); | |
| if (!hasLabel) { | |
| core.info('PR does not have enable-auto-merge label, skipping auto-merge trigger'); | |
| return; | |
| } | |
| // Dispatch event to trigger auto-merge workflow | |
| await github.rest.repos.createDispatchEvent({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| event_type: 'nvfuser-ci-success', | |
| client_payload: { | |
| pr_number: ${{ inputs.pr_number }}, | |
| commit_sha: '${{ inputs.commit_sha }}' | |
| } | |
| }); | |
| core.info(`Triggered auto-merge check for PR #${{ inputs.pr_number }}`); |