name: Update Instance Types

on:
  workflow_dispatch:
  schedule:
  - cron: '0 0 * * *'

jobs:
  update-instance-types:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up system
      run: bin/before_install
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 2.7
        bundler-cache: true
    - name: Run instance_types rake task
      run: bundle exec rake aws:extract:instance_types
    - name: Create Pull Request
      uses: peter-evans/create-pull-request@v4
      with:
        add-paths: db/fixtures/aws_instance_types.yml
        commit-message: Update AWS instance_types
        branch: update_aws_instance_types
        delete-branch: true
        push-to-fork: miq-bot/manageiq-providers-amazon
        title: Update AWS instance_types
        body: Update the saved list of AWS instance_types from https://instances.vantage.sh/instances.json
        token: ${{ secrets.DEPLOY_TOKEN }}

name: Update Instance Types

on:
  workflow_dispatch:
  schedule:
  - cron: '0 0 * * *'

jobs:
  update-instance-types:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up system
      run: bin/before_install
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 2.7
        bundler-cache: true
    - name: Run instance_types rake task
      run: bundle exec rake aws:extract:instance_types
    - name: Create Pull Request
      uses: peter-evans/create-pull-request@v4
      with:
        add-paths: db/fixtures/aws_instance_types.yml
        commit-message: Update AWS instance_types
        branch: update_aws_instance_types
        author: ManageIQ Bot <bot@manageiq.org>
        committer: ManageIQ Bot <bot@manageiq.org>
        delete-branch: true
        push-to-fork: miq-bot/manageiq-providers-amazon
        title: Update AWS instance_types
        body: Update the saved list of AWS instance_types from https://instances.vantage.sh/instances.json
        token: ${{ secrets.DEPLOY_TOKEN }}

Set the author/committer to miq-bot
Set the author/committer to miq-bot
