commit

in lib/release_tools/auto_deploy/builder/cng_image.rb [61:92]


        def commit(new_variables)
          return if SharedStatus.dry_run?

          action = {
            action: 'update',
            file_path: VARIABLES_FILE,
            content: { 'variables' => new_variables }.to_yaml
          }

          commit = Retriable.with_context(:api) do
            GitlabClient.create_commit(
              PROJECT.auto_deploy_path,
              @target_name,
              'Update component versions',
              [action]
            )
          end

          logger.info('Updated CNG versions', url: commit.web_url)

          commit
        rescue ::Gitlab::Error::ResponseError => ex
          logger.warn(
            'Failed to commit CNG version changes',
            target: @target_name,
            error_code: ex.response_status,
            error_message: ex.response_message
          )

          raise ex
        end