forked from gravitational/teleport
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.46 KB
/
update-ami-ids.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Update AMI IDs
on:
workflow_dispatch:
inputs:
version:
required: true
type: string
description: Release version tag (ex. 12.1.0)
workflow_call:
inputs:
version:
required: true
type: string
description: Release version tag (ex. 12.1.0)
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
update-ami-ids:
name: Update AMI IDs
runs-on: ubuntu-latest
environment: post-release
steps:
- name: Generate Github token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
with:
app_id: ${{ vars.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: master
- name: Assume AWS role
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-west-2
role-to-assume: "arn:aws:iam::126027368216:role/tf-teleport-ami-gha-role"
role-session-name: "gha-update-ami-ids-${{ github.run_number }}"
- name: Update AMI IDs and create PR
run: |
git config --global user.email "noreply@github.com"
git config --global user.name "GitHub"
TELEPORT_VERSION=${{ inputs.version }} make -C assets/aws create-update-pr
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}