<commit_before>name: Upload bottles

on:
  push:
    branches: [master]

jobs:
  upload-bottles:
    runs-on: ubuntu-latest
    container:
      image: homebrew/brew
    steps:
      - name: Get artifact data
        uses: actions/github-script@0.4.0
        id: artifact
        with:
          debug: true
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            const prs = github.repos.listPullRequestsAssociatedWithCommit({
              owner: context.repo.owner,
              repo: context.repo.repo,
              commit_sha: "e2575cfdc20129b94f8268a3b9594ca61f21f4b0"
            })
            console.log(prs)
            console.log(prs.length + " prs")
            const pr = prs[0]
            console.log("first pr head ref=" + pr.head.ref)
            const runs = github.actions.listWorkflowRuns({
              owner: context.repo.owner,
              repo: context.repo.repo,
              workflow_id: "build-bottles.yml",
              branch: pr.head.ref
              })
            console.log(runs.total_count + " runs")
            const artifacts = github.actions.listWorkflowRunArtifacts({
              owner: context.repo.owner,
              repo: context.repo.repo,
              run_id: runs.workflow_runs[0].id
              })
            console.log(artifacts.total_count + " artifacts")
            console.log("Artifact <" + artifacts[0].archive_download_url + ">")
            return {id: artifacts[0].id, success: true}
      - name: Download artifacts
        env:
          HOMEBREW_BINTRAY_USER: linuxbrewtestbot
          HOMEBREW_BINTRAY_KEY: ${{secrets.HOMEBREW_BINTRAY_KEY}}
          HOMEBREW_NO_ANALYTICS: 1
          HOMEBREW_NO_AUTO_UPDATE: 1
        if: steps.artifact.outputs.success<commit_msg>workflows: use blocking network calls<commit_after>name: Upload bottles

on:
  push:
    branches: [master]

jobs:
  upload-bottles:
    runs-on: ubuntu-latest
    container:
      image: homebrew/brew
    steps:
      - name: Get artifact data
        uses: actions/github-script@0.4.0
        id: artifact
        with:
          debug: true
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            const prs = await github.repos.listPullRequestsAssociatedWithCommit({
              owner: context.repo.owner,
              repo: context.repo.repo,
              commit_sha: "e2575cfdc20129b94f8268a3b9594ca61f21f4b0"
            })
            console.log(prs.length + " prs")
            const pr = prs[0]
            console.log("first pr head ref=" + pr.head.ref)
            const runs = await github.actions.listWorkflowRuns({
              owner: context.repo.owner,
              repo: context.repo.repo,
              workflow_id: "build-bottles.yml",
              branch: pr.head.ref
              })
            console.log(runs.total_count + " runs")
            const artifacts = await github.actions.listWorkflowRunArtifacts({
              owner: context.repo.owner,
              repo: context.repo.repo,
              run_id: runs.workflow_runs[0].id
              })
            console.log(artifacts.total_count + " artifacts")
            console.log("Artifact <" + artifacts[0].archive_download_url + ">")
            return {id: artifacts[0].id, success: true}
      - name: Download artifacts
        env:
          HOMEBREW_BINTRAY_USER: linuxbrewtestbot
          HOMEBREW_BINTRAY_KEY: ${{secrets.HOMEBREW_BINTRAY_KEY}}
          HOMEBREW_NO_ANALYTICS: 1
          HOMEBREW_NO_AUTO_UPDATE: 1
        if: steps.artifact.outputs.success
{'fraction_non_alphanumeric': 0.09884863802302724, 'fraction_numerical': 0.01965739960685201, 'mean_word_length': 1.8450479233226837, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1063620', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1073, 'n_words': 193}