name: Set automatic_deploys_enabled (optionally image_tag too)

on:
  workflow_dispatch:
    inputs:
      resetImageTag:
        description: 'Reset image tag to main'
        required: false
        default: false
        type: boolean
      automaticDeploysEnabled:
        description: 'Activate automatic deploys'
        required: false
        default: true
        type: boolean
      environment:
        description: 'Environment to deploy to'
        required: true
        type: choice
        options:
        - integration
        - staging
        - production
        default: 'integration'

jobs:
  set_automatic_deploys_enabled:
    name: Set automatic_deploys_enabled to ${{ github.event.inputs.environment }}
    uses: alphagov/govuk-infrastructure/.github/workflows/set-automatic-deploys-enabled.yaml@main
    with:
      resetImageTag: ${{ github.event.inputs.resetImageTag == 'true' }}
      automaticDeploysEnabled: ${{ github.event.inputs.automaticDeploysEnabled == 'true' }}
      environment: ${{ github.event.inputs.environment }}
    secrets:
      WEBHOOK_TOKEN: ${{ secrets.GOVUK_INTEGRATION_ARGO_EVENTS_WEBHOOK_TOKEN }}
      WEBHOOK_URL: ${{ secrets.GOVUK_INTEGRATION_ARGO_EVENTS_WEBHOOK_URL }}
      GOVUK_CI_GITHUB_API_TOKEN: ${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }}

name: Set automatic deploys

run-name: Set automatic deploys to ${{ inputs.setAutomaticDeploys }} in ${{ inputs.environment }}

on:
  workflow_dispatch:
    inputs:
      setAutomaticDeploys:
        description: 'Set automatic deploys'
        required: false
        type: choice
        options:
        - enabled
        - disabled
        default: 'enabled'
      environment:
        description: 'Environment'
        required: true
        type: choice
        options:
        - integration
        - staging
        - production
        default: 'integration'

jobs:
  set-automatic-deploys:
    name: Set automatic deploys
    uses: alphagov/govuk-infrastructure/.github/workflows/set-automatic-deploys.yaml@main
    with:
      automaticDeploysEnabled: ${{ github.event.inputs.automaticDeploys == 'enabled' }}
      environment: ${{ github.event.inputs.environment }}
    secrets:
      WEBHOOK_TOKEN: ${{ secrets.GOVUK_ARGO_EVENTS_WEBHOOK_TOKEN }}
      WEBHOOK_URL: ${{ secrets.GOVUK_ARGO_EVENTS_WEBHOOK_URL }}
      GH_TOKEN: ${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }}

Update set automatic deploy workflow
Update set automatic deploy workflow

This updates the workflow to use the changes in the resuable workflow.
