|
4 | 4 | repository_dispatch: |
5 | 5 | types: [spec_update] |
6 | 6 |
|
7 | | -permissions: # least privilege; PR creation uses the SPEC_UPDATE_TOKEN PAT |
| 7 | +permissions: |
| 8 | + id-token: write |
8 | 9 | contents: read |
9 | 10 |
|
10 | 11 | jobs: |
11 | 12 | Update: |
12 | 13 | runs-on: ubuntu-latest |
13 | 14 | steps: |
| 15 | + - name: Configure AWS credentials |
| 16 | + uses: aws-actions/configure-aws-credentials@v6 |
| 17 | + with: |
| 18 | + role-to-assume: arn:aws:iam::082972943155:role/oidc-github-dropbox-dropbox-sdk-python-repo |
| 19 | + aws-region: us-west-2 |
| 20 | + |
| 21 | + - name: Fetch GitHub App credentials from Secrets Manager |
| 22 | + uses: aws-actions/aws-secretsmanager-get-secrets@v3 |
| 23 | + with: |
| 24 | + secret-ids: | |
| 25 | + SDK_UPDATER,sdk-updater-github-app |
| 26 | + parse-json-secrets: true |
| 27 | + |
| 28 | + - name: Generate GitHub App installation token |
| 29 | + id: app-token |
| 30 | + uses: actions/create-github-app-token@v3 |
| 31 | + with: |
| 32 | + client-id: ${{ env.SDK_UPDATER_CLIENT_ID }} |
| 33 | + private-key: ${{ env.SDK_UPDATER_PRIVATE_KEY }} |
| 34 | + |
14 | 35 | - uses: actions/checkout@v7 |
15 | 36 | - name: Setup Python environment |
16 | 37 | uses: actions/setup-python@v6 |
@@ -64,10 +85,11 @@ jobs: |
64 | 85 | pip install -r requirements.txt |
65 | 86 | python generate_base_client.py |
66 | 87 | - name: Create Pull Request |
| 88 | + id: create-pr |
67 | 89 | uses: peter-evans/create-pull-request@v8 |
68 | 90 | if: steps.git-diff-num.outputs.num-diff != 0 |
69 | 91 | with: |
70 | | - token: ${{ secrets.SPEC_UPDATE_TOKEN }} |
| 92 | + token: ${{ steps.app-token.outputs.token }} |
71 | 93 | commit-message: | |
72 | 94 | ${{ steps.git-diff.outputs.commit}} |
73 | 95 | branch: ${{ steps.git-branch.outputs.branch }} |
|
80 | 102 | owners |
81 | 103 | maintainers |
82 | 104 | draft: false |
| 105 | +
|
| 106 | + # - name: Enable Pull Request Automerge |
| 107 | + # if: steps.create-pr.outputs.pull-request-number |
| 108 | + # run: gh pr merge --merge --auto "${{ steps.create-pr.outputs.pull-request-number }}" |
| 109 | + # env: |
| 110 | + # GH_TOKEN: ${{ steps.app-token.outputs.token }} |
0 commit comments