From 7fed643c47ae0f18f7a628bbdc363f9c9616e800 Mon Sep 17 00:00:00 2001 From: Franz Diebold Date: Mon, 10 Feb 2020 23:14:54 +0100 Subject: [PATCH] Add info logging. --- dist/index.js | 8 ++++++-- index.js | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index e88d0ca..8967d20 100644 --- a/dist/index.js +++ b/dist/index.js @@ -160,11 +160,15 @@ function slugify(str) { // https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables try { - splitted_github_repository = process.env.GITHUB_REPOSITORY.split('/'); // octocat/Hello-World + splitted_github_repository = process.env.GITHUB_REPOSITORY.split('/'); // octocat/Hello-World process.env['GITHUB_REPO_OWNER'] = slugify(splitted_github_repository[0]); + core.info(`Set GITHUB_REPO_OWNER=${process.env.GITHUB_REPO_OWNER}`); process.env['GITHUB_REPO_NAME'] = slugify(splitted_github_repository[1]); - splitted_github_ref = process.env.GITHUB_REF.split('/'); // refs/heads/feature-branch-1 + core.info(`Set GITHUB_REPO_NAME=${process.env.GITHUB_REPO_NAME}`); + + splitted_github_ref = process.env.GITHUB_REF.split('/'); // refs/heads/feature-branch-1 process.env['GITHUB_BRANCH_NAME'] = slugify(splitted_github_ref[2]); + core.info(`Set GITHUB_BRANCH_NAME=${process.env.GITHUB_BRANCH_NAME}`); } catch (error) { core.setFailed(error.message); } diff --git a/index.js b/index.js index 8062598..98220d1 100644 --- a/index.js +++ b/index.js @@ -15,9 +15,13 @@ function slugify(str) { try { splitted_github_repository = process.env.GITHUB_REPOSITORY.split('/'); // octocat/Hello-World process.env['GITHUB_REPO_OWNER'] = slugify(splitted_github_repository[0]); + core.info(`Set GITHUB_REPO_OWNER=${process.env.GITHUB_REPO_OWNER}`); process.env['GITHUB_REPO_NAME'] = slugify(splitted_github_repository[1]); + core.info(`Set GITHUB_REPO_NAME=${process.env.GITHUB_REPO_NAME}`); + splitted_github_ref = process.env.GITHUB_REF.split('/'); // refs/heads/feature-branch-1 process.env['GITHUB_BRANCH_NAME'] = slugify(splitted_github_ref[2]); + core.info(`Set GITHUB_BRANCH_NAME=${process.env.GITHUB_BRANCH_NAME}`); } catch (error) { core.setFailed(error.message); }