Breaking Change - Add Label Artifacts #25785
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
| name: "Breaking Change - Add Label Artifacts" | |
| on: | |
| workflow_run: | |
| workflows: | |
| - "Swagger BreakingChange - Analyze Code" | |
| - "Breaking Change(Cross-Version) - Analyze Code" | |
| types: [completed] | |
| permissions: | |
| # Required for github.rest.actions.listWorkflowRunsForRepo() | |
| actions: read | |
| contents: read | |
| # Required for github.rest.repos.listPullRequestsAssociatedWithCommit() | |
| issues: read | |
| pull-requests: read | |
| jobs: | |
| breaking-change-add-label-artifacts: | |
| name: "Breaking Change - Add Label Artifacts" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| # *** IMPORTANT *** | |
| # For workflows that are triggered by the pull_request_target event, the workflow runs in the | |
| # context of the base of the pull request. You should make sure that you do not check out, | |
| # build, or run untrusted code from the head of the pull request. | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Only needs .github folder for automation, not the files in the PR (analyzed in a | |
| # separate workflow). | |
| # | |
| # Uses the .github folder from the PR base branch (pull_request_target trigger), | |
| # or the repo default branch (other triggers). | |
| sparse-checkout: | | |
| .github | |
| - id: get-label-actions | |
| name: Get Label Actions | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { default: getLabelActions } = | |
| await import('${{ github.workspace }}/.github/workflows/src/breaking-change-add-label-artifacts.js'); | |
| return await getLabelActions({ github, context, core }); | |
| # Upload artifact for 'BreakingChangeReviewRequired' label | |
| - if: | | |
| always() && | |
| (steps.get-label-actions.outputs.breakingChangeReviewLabelName != '') | |
| name: Upload artifact with BreakingChangeReviewRequiredLabel label | |
| uses: ./.github/actions/add-label-artifact | |
| with: | |
| name: "${{ steps.get-label-actions.outputs.breakingChangeReviewLabelName }}" | |
| value: "${{ steps.get-label-actions.outputs.breakingChangeReviewLabelValue == 'true' }}" | |
| # Upload artifact for 'VersioningReviewRequired' label | |
| - if: | | |
| always() && | |
| (steps.get-label-actions.outputs.versioningReviewLabelName != '') | |
| name: Upload artifact with VersioningReviewRequiredLabel label | |
| uses: ./.github/actions/add-label-artifact | |
| with: | |
| name: "${{ steps.get-label-actions.outputs.versioningReviewLabelName }}" | |
| value: "${{ steps.get-label-actions.outputs.versioningReviewLabelValue == 'true' }}" | |
| - if: ${{ always() && steps.get-label-actions.outputs.head_sha }} | |
| name: Upload artifact with head SHA | |
| uses: ./.github/actions/add-empty-artifact | |
| with: | |
| name: head-sha | |
| value: ${{ steps.get-label-actions.outputs.head_sha }} | |
| - if: ${{ always() && steps.get-label-actions.outputs.issue_number > 0 }} | |
| name: Upload artifact with issue number | |
| uses: ./.github/actions/add-empty-artifact | |
| with: | |
| name: issue-number | |
| value: ${{ steps.get-label-actions.outputs.issue_number }} |