mirror of
https://github.com/FranzDiebold/github-env-vars-action.git
synced 2024-12-31 19:34:55 -05:00
Add info logging.
This commit is contained in:
parent
e545f221ed
commit
7fed643c47
2 changed files with 10 additions and 2 deletions
8
dist/index.js
vendored
8
dist/index.js
vendored
|
@ -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);
|
||||
}
|
||||
|
|
4
index.js
4
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue