Skip to content

Commit

Permalink
Update main.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
joosangkim authored May 30, 2024
1 parent 72a969d commit c0076a0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as github from '@actions/github';
import * as fs from 'fs';
import * as path from 'path';
import nodeFetch from 'node-fetch';
import * as os from 'os';

interface ExecResult {
err?: Error | undefined;
Expand All @@ -29,10 +30,9 @@ interface App {
};
};
}
const PLATFORM = process.platform || 'linux';
const ARCH = process.arch || 'amd64';
const PLATFORM = os.platform() || 'linux';
const ARCH = os.arch() || 'amd64';
const githubToken = core.getInput('github-token');
core.info(githubToken);
const ARGOCD_SERVER_URL = core.getInput('argocd-server-url');
const ARGOCD_TOKEN = core.getInput('argocd-token');
const VERSION = core.getInput('argocd-version');
Expand Down Expand Up @@ -69,6 +69,7 @@ function scrubSecrets(input: string): string {

async function setupArgoCDCommand(): Promise<(params: string) => Promise<ExecResult>> {
const argoBinaryPath = 'bin/argo';
const arch = === 'x64' ? 'amd64' : os.arch()
await tc.downloadTool(
`https://github.com/argoproj/argo-cd/releases/download/${VERSION}/argocd-${PLATFORM}-${ARCH}`,
argoBinaryPath
Expand All @@ -86,9 +87,7 @@ async function setupArgoCDCommand(): Promise<(params: string) => Promise<ExecRes
async function getApps(): Promise<App[]> {
const url = `https://${ARGOCD_SERVER_URL}/api/v1/applications?fields=items.metadata.name,items.spec.source.path,items.spec.source.repoURL,items.spec.source.targetRevision,items.spec.source.helm,items.spec.source.kustomize,items.status.sync.status`;
core.info(`Fetching apps from: ${url}`);
core.info(process.arch)
core.info(process.platform)
core.info(`https://github.com/argoproj/argo-cd/releases/download/${VERSION}/argocd-${PLATFORM}-${ARCH}`)
core.info(`https://github.com/argoproj/argo-cd/releases/download/${VERSION}/argocd-${PLATFORM}-${ARCH}`);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let responseJson: any;
try {
Expand Down

0 comments on commit c0076a0

Please sign in to comment.