From ce50e97d32cd9a043c6da4583b4206aafeef0ae6 Mon Sep 17 00:00:00 2001 From: Maxim Topciu Date: Sat, 27 Apr 2024 22:12:12 +0300 Subject: [PATCH] show version --- bamboo-specs/example.yaml | 2 ++ src/cli/cli.ts | 2 ++ src/lib/GitHubActionsRunner.ts | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/bamboo-specs/example.yaml b/bamboo-specs/example.yaml index 80fbca4..b6d48a7 100644 --- a/bamboo-specs/example.yaml +++ b/bamboo-specs/example.yaml @@ -46,6 +46,8 @@ Test: # Combine stderr and stdout for consistent log output. exec 2>&1 + github-actions-runner -V + GITHUB_TOKEN=${bamboo.githubActionsRunnerPassword} github-actions-runner run-action \ --repo AdguardTeam/GithubActionsRunner \ --branch "${bamboo_planRepository_branchName}" \ diff --git a/src/cli/cli.ts b/src/cli/cli.ts index d72ca2d..37bd915 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -114,6 +114,7 @@ program.command('run-action') workflowRunCompletionTimeout, secret: secrets, syncSecrets, + version, } = options; const token = process.env.GITHUB_TOKEN; if (!token) { @@ -142,6 +143,7 @@ program.command('run-action') workflowRunCompletionTimeoutMs: workflowRunCompletionTimeout, secrets, syncSecrets, + version, }); } catch (e) { logger.error(e); diff --git a/src/lib/GitHubActionsRunner.ts b/src/lib/GitHubActionsRunner.ts index 1ba9fde..6346809 100644 --- a/src/lib/GitHubActionsRunner.ts +++ b/src/lib/GitHubActionsRunner.ts @@ -81,6 +81,11 @@ interface RunActionOptions { * If true, it will sync secrets with the repository and remove any secrets that are not in the provided list. */ syncSecrets?: boolean; + + /** + * A github-actions-runner version. + */ + version: string; } /** @@ -147,6 +152,7 @@ export class GitHubActionsRunner { * @param root0.workflowRunCompletionTimeoutMs Wait for workflow run completion timeout. * @param root0.secrets Secrets to pass to the action. * @param root0.syncSecrets Sync secrets with the repository. + * @param root0.version github actions runner version. * @returns A promise that resolves when the action is completed. * @throws Error if something went wrong. */ @@ -161,7 +167,9 @@ export class GitHubActionsRunner { workflowRunCompletionTimeoutMs, secrets, syncSecrets, + version, }: RunActionOptions): Promise { + logger.info(`github-actions-runner version: ${version}`); logger.info(`Starting action for repository "${this.owner}/${this.repo}"`); logger.info(`Workflow: "${workflow}"`); logger.info(`Revision: "${rev}"`);