Github activities automation runs in local but not in render.com

const app = express()
const git = simpleGit();

app.use(express.json())

app.use(cors({ origin: "app", credentials: true }));

var allowCrossDomain = function (req, res, next) {
    // res.header('Access-Control-Allow-Origin', "*");
    // res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
    // res.header('Access-Control-Allow-Headers', 'Content-Type');
    res.setHeader(
        "Access-Control-Allow-Origin",
        "https://guileless-jalebi-432852.netlify.app/"
    );
    res.setHeader(
        "Access-Control-Allow-Methods",
        "GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS,CONNECT,TRACE"
    );
    res.setHeader(
        "Access-Control-Allow-Headers",
        "Content-Type, Authorization, X-Content-Type-Options, Accept, X-Requested-With, Origin, Access-Control-Request-Method, Access-Control-Request-Headers"
    );
    res.setHeader("Access-Control-Allow-Credentials", true);
    res.setHeader("Access-Control-Allow-Private-Network", true);
    //  Firefox caps this at 24 hours (86400 seconds). Chromium (starting in v76) caps at 2 hours (7200 seconds). The default value is 5 seconds.
    res.setHeader("Access-Control-Max-Age", 7200);
    next();
}
app.use(allowCrossDomain);

const writeFileAsync = util.promisify(fs.writeFile);
const filePath = 'dist/src/assets/model.js';

// Set up GitLab credentials using a personal access token
var count = 0
var gitlabToken = 'MY_TOKEN';
import ping from 'ping';

ping.promise.probe('gitlab.com')
    .then((res) => {
        console.log(res);
    })
    .catch((err) => {
        console.error(`Error: ${err}`);
    });


// process.env.CLOUDFLARE_ACCOUNT_ID = '175feb9970fba9d1708daac3b2c7494d';
const ensureOriginConfigured = async () => {
    try {
        await git.init();
        git.addConfig('credential.helper', `store --file=.git/credentials`);
        git.addConfig('user.name', 'Suprith');
        git.addConfig('user.email', 'suprith7kg@gmail.com');
        fs.writeFileSync('.git/credentials', `https://oauth2:${gitlabToken}@gitlab.com`);
        const remotes = await git.getRemotes(true);
        const originExists = remotes.some(remote => remote.name === 'origin');

        if (!originExists) {
            await git.addRemote('origin', 'https://gitlab.com/freel11/lit-backend.git');
        }
        console.log(remotes)
    } catch (error) {
        console.error(`Error ensuring 'origin' is configured: ${error.message}`);
    }
};

Actually ping gitlab.com says server not reachable… what should i do

Hi,

I replied to your other community topic, let’s keep the conversation in one place: https://community.render.com/t/ping-gitlab-com-shows-not-reachable/19675/3

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.