get method

Future<PublishSkipDecision> get({
  1. required Node repo,
  2. required Map<String, String> refVersions,
})

Returns the skip decision for repo.

refVersions maps the package names of the repositories processed earlier in this run to the version they now have (published repos carry their fresh version, skipped repos their unchanged one).

Implementation

Future<PublishSkipDecision> get({
  required Node repo,
  required Map<String, String> refVersions,
}) async {
  final dependencyReason = _dependencyPublishReason(repo, refVersions);
  if (dependencyReason != null) {
    return PublishSkipDecision(skip: false, reason: dependencyReason);
  }

  final manualChangeReason = await _manualChangeReason(repo.directory);
  if (manualChangeReason != null) {
    return PublishSkipDecision(skip: false, reason: manualChangeReason);
  }

  return const PublishSkipDecision(
    skip: true,
    reason: 'Nothing changed. Skip publishing.',
  );
}