pytorch/.github/workflows/upload_test_stats_intermediate.yml
Catherine Lee e95bd337e1 Some workflows to use oidc instead of AWS keys (#142264)
Roles defined in https://github.com/pytorch-labs/pytorch-gha-infra/pull/563

With this, I think we can get rid of the AWS credentials in the upload-stats environment

Untestable because I can't add branches to the upload-stats environment
Pull Request resolved: https://github.com/pytorch/pytorch/pull/142264
Approved by: https://github.com/huydhn
2024-12-10 19:40:23 +00:00

45 lines
1.2 KiB
YAML

name: Upload test stats intermediate
on:
workflow_dispatch:
inputs:
workflow_id:
description: workflow_id of the run
required: true
permissions:
id-token: write
jobs:
intermediate_upload_test_stats:
name: Intermediate upload test stats for ${{ inputs.workflow_id }}
runs-on: ubuntu-22.04
environment: upload-stats
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: pip
- run: |
pip3 install requests==2.32.2 boto3==1.35.42
- name: Authenticate with AWS
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::308535385114:role/gha_upload_test_stats_intermediate_workflow
aws-region: us-east-1
- name: Upload test stats
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_RUN_ID: ${{ inputs.workflow_id }}
run: |
python3 -m tools.stats.upload_test_stats_intermediate \
--workflow-run-id "${WORKFLOW_RUN_ID}"