Skip to content

APICodeGen

APICodeGen #1

Workflow file for this run

name: "APICodeGen"
on:
schedule:
- cron: '0 13 * * MON'
permissions:
id-token: write
pull-requests: write
contents: write
jobs:
codegen:
if: github.repository == 'aws/karpenter'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- run: |
git config user.name "APICodeGen"
git config user.email "[email protected]"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git config pull.rebase false
- uses: ./.github/actions/authenticate-aws
- run: make codegen
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_GIT_PUSH: true
- run: export APICodeGenUpdate=$((cat /tmp/codegen-updates && echo "APICodeGenUpdate=true" >> $GITHUB_ENV) || echo "false")
- name: Create Pull Request
if: env.APICodeGenUpdate == 'true'
uses: actions/github-script@v6
with:
script: |
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: 'chore: Update data from AWS APIs',
owner,
repo,
head: 'codegen',
base: 'main',
body: [
'Updates auto generated files with data from the AWS APIs for pricing and VPC limits. Please remove the branch after merging.',
'This PR is generated by [APICodeGen](https://github.com/aws/karpenter/actions/workflows/codegen.yml).'
].join('\n')
});
github.rest.issues.addLabels({
owner,
repo,
issue_number: result.data.number,
labels: ['aws', 'dependencies']
});