{
  "analyze_checkout": {
    "fetch-depth": 0,
    "persist-credentials": false,
    "ref": "${{ github.workflow_sha }}"
  },
  "analyze_if": "needs.resolve-pr.outputs.should_analyze == 'true'",
  "analyze_needs": "resolve-pr",
  "diff_env": {
    "GH_TOKEN": "${{ github.token }}",
    "MERGE_SHA": "${{ needs.resolve-pr.outputs.merge_sha }}",
    "PR_NUMBER": "${{ needs.resolve-pr.outputs.pr_number }}"
  },
  "last_update_step": {
    "env": {
      "GH_TOKEN": "${{ github.token }}"
    },
    "name": "Add breaking-change-analyzed label",
    "run": "gh api \\\n  --method POST \\\n  -H \"Accept: application/vnd.github+json\" \\\n  \"/repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels\" \\\n  -f labels[]=\"breaking-change-analyzed\" \\\n  --silent\n"
  },
  "prompt_pr_references": 2,
  "resolve": {
    "if": "(github.event_name == 'repository_dispatch' && github.event.action == 'release-draft-replay' && github.ref == 'refs/heads/main') ||\n(github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)\n",
    "outputs": {
      "changed_files": "${{ steps.pr.outputs.changed_files }}",
      "merge_sha": "${{ steps.pr.outputs.merge_sha }}",
      "pr_number": "${{ steps.pr.outputs.pr_number }}",
      "should_analyze": "${{ steps.pr.outputs.should_analyze }}"
    },
    "permissions": {
      "contents": "read",
      "pull-requests": "read"
    },
    "runs-on": "ubuntu-latest",
    "steps": [
      {
        "name": "Checkout repository",
        "uses": "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1",
        "with": {
          "persist-credentials": false,
          "ref": "${{ github.workflow_sha }}"
        }
      },
      {
        "env": {
          "GH_TOKEN": "${{ github.token }}",
          "REQUESTED_PR": "${{ github.event.client_payload.pr_number || github.event.pull_request.number }}"
        },
        "id": "pr",
        "name": "Resolve merged PR",
        "run": "set -euo pipefail\nif [[ ! \"$REQUESTED_PR\" =~ ^[1-9][0-9]*$ ]]; then\n  echo \"Expected a positive PR number.\" >&2\n  exit 1\nfi\npr_path=\"$RUNNER_TEMP/release-draft-pr.json\"\ngh api \"/repos/$GITHUB_REPOSITORY/pulls/$REQUESTED_PR\" \\\n  --jq '{number, merged, merge_commit_sha, changed_files, base: {ref: .base.ref, repo: {full_name: .base.repo.full_name}}, labels: [.labels[] | {name}]}' \\\n  > \"$pr_path\"\npython3 scripts/resolve_release_draft_pr.py \\\n  --pr-path \"$pr_path\" \\\n  --pr-number \"$REQUESTED_PR\" \\\n  --repository \"$GITHUB_REPOSITORY\" \\\n  --github-output-path \"$GITHUB_OUTPUT\"\n"
      }
    ]
  },
  "route": "python3 scripts/prepare_release_draft_analysis.py \\\n  --changed-files-path \"${{ steps.pr-diff.outputs.trusted_changed_files_path }}\" \\\n  --expected-changed-files \"${{ needs.resolve-pr.outputs.changed_files }}\" \\\n  --analysis-path \"${{ steps.pr-diff.outputs.analysis_path }}\" \\\n  --github-output-path \"$GITHUB_OUTPUT\"\n",
  "triggers": {
    "pull_request_target": {
      "branches": [
        "main"
      ],
      "types": [
        "closed"
      ]
    },
    "repository_dispatch": {
      "types": [
        "release-draft-replay"
      ]
    }
  },
  "update_env": {
    "PR_NUMBER": "${{ needs.resolve-pr.outputs.pr_number }}"
  },
  "update_needs": [
    "resolve-pr",
    "analyze"
  ],
  "validator_pr": "${{ needs.resolve-pr.outputs.pr_number }}"
}
