---
- scm:
    name: govuk-provisioning_Check_GitHub_IP_Ranges
    scm:
        - git:
            url: git@github.com:alphagov/govuk-provisioning.git
            branches:
              - master
            wipe-workspace: false

- job:
    name: Check_GitHub_IP_Ranges
    display-name: Check GitHub IP Ranges
    project-type: freestyle
    description: "This job compares the IP ranges that GitHub publishes against the ranges configured in govuk-provisioning and errors if they don't match."
    properties:
        - build-discarder:
            days-to-keep: 30
            artifact-num-to-keep: 5
        - github:
            url: https://github.com/alphagov/govuk-provisioning/
    scm:
      - govuk-provisioning_Check_GitHub_IP_Ranges
    builders:
        - shell: |
            bundle install --path "${HOME}/bundles/${JOB_NAME}" --deployment
            bundle exec ./tools/github_ips.rb
    publishers:
        - trigger-parameterized-builds:
            - project: Success_Passive_Check
              condition: 'SUCCESS'
              predefined-parameters: |
                  NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                  NSCA_OUTPUT=<%= @service_description %> success
            - project: Failure_Passive_Check
              condition: 'FAILED'
              predefined-parameters: |
                  NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                  NSCA_OUTPUT=<%= @service_description %> failed
    triggers:
        - timed: |
            TZ=Europe/London
            H 3 * * *

---
- scm:
    name: govuk-provisioning_Check_GitHub_IP_Ranges
    scm:
        - git:
            url: git@github.com:alphagov/govuk-provisioning.git
            branches:
              - main
            wipe-workspace: false

- job:
    name: Check_GitHub_IP_Ranges
    display-name: Check GitHub IP Ranges
    project-type: freestyle
    description: "This job compares the IP ranges that GitHub publishes against the ranges configured in govuk-provisioning and errors if they don't match."
    properties:
        - build-discarder:
            days-to-keep: 30
            artifact-num-to-keep: 5
        - github:
            url: https://github.com/alphagov/govuk-provisioning/
    scm:
      - govuk-provisioning_Check_GitHub_IP_Ranges
    builders:
        - shell: |
            bundle install --path "${HOME}/bundles/${JOB_NAME}" --deployment
            bundle exec ./tools/github_ips.rb
    publishers:
        - trigger-parameterized-builds:
            - project: Success_Passive_Check
              condition: 'SUCCESS'
              predefined-parameters: |
                  NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                  NSCA_OUTPUT=<%= @service_description %> success
            - project: Failure_Passive_Check
              condition: 'FAILED'
              predefined-parameters: |
                  NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                  NSCA_OUTPUT=<%= @service_description %> failed
    triggers:
        - timed: |
            TZ=Europe/London
            H 3 * * *

Update "Check GitHub IP Ranges" job's default branch
Update "Check GitHub IP Ranges" job's default branch

We are updating the https://github.com/alphagov/govuk-provisioning
repo to use `main` as the default branch name.
