"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isBitbucketRemoteUrl = isBitbucketRemoteUrl;
exports.buildBitbucketSuperblocksSyncPipeline = buildBitbucketSuperblocksSyncPipeline;
exports.buildBitbucketSuperblocksSyncPipelineFromBaseUrl = buildBitbucketSuperblocksSyncPipelineFromBaseUrl;
const github_workflow_js_1 = require("./github-workflow.js");
function isBitbucketRemoteUrl(remoteUrl) {
    return /(^git@bitbucket\.org:)|(^https?:\/\/([^@]+@)?bitbucket\.org\/)|(^ssh:\/\/git@bitbucket\.org\/)/.test(remoteUrl.trim());
}
function buildBitbucketSuperblocksSyncPipeline(domain = github_workflow_js_1.DEFAULT_SUPERBLOCKS_DOMAIN) {
    return `image: superblocksteam/sync-action:v1

pipelines:
  branches:
    main:
      - step:
          name: Sync to Superblocks
          clone:
            depth: full
          script:
            - export SUPERBLOCKS_DOMAIN='${domain}' && /entrypoint.sh
          after-script:
            - echo "Superblocks sync complete"
`;
}
function buildBitbucketSuperblocksSyncPipelineFromBaseUrl(superblocksBaseUrl) {
    return buildBitbucketSuperblocksSyncPipeline((0, github_workflow_js_1.getSuperblocksDomainFromBaseUrl)(superblocksBaseUrl));
}
//# sourceMappingURL=bitbucket-workflow.js.map