Skip to content

Commit

Permalink
Build v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ahqsoftwares committed Mar 10, 2024
1 parent 928ab52 commit 72b1a59
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 29 additions & 29 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,42 @@ import * as core from '@actions/core'

const Exec = promisify(exec)

; (async () => {
const { stdout } = await Exec('cargo install ahqstore_cli_rs')
;(async () => {
const { stdout } = await Exec('cargo install ahqstore_cli_rs')

console.log(stdout)
console.log(stdout)

const { owner, repo } = context.repo
const { owner, repo } = context.repo

const rep = `${owner}/${repo}`
const rep = `${owner}/${repo}`

const r_id = core.getInput('release')
const r_id = core.getInput('release')

if (!process.env['GH_TOKEN']) {
core.error('GH_TOKEN environment variable is not set')
}
if (!process.env['GH_TOKEN']) {
core.error('GH_TOKEN environment variable is not set')
}

const { stdout: out } = await Exec('ahqstore upload', {
env: {
...process.env,
RELEASE_ID: r_id,
GITHUB_REPOSITORY: rep,
GH_ACTION: 'true'
}
})
const { stdout: out } = await Exec('ahqstore upload', {
env: {
...process.env,
RELEASE_ID: r_id,
GITHUB_REPOSITORY: rep,
GH_ACTION: 'true'
}
})

const [k, value] = out.trim().split('=')
const [k, value] = out.trim().split('=')

core.info(`Got "${k}" as "${value}"`)
core.info(`Got "${k}" as "${value}"`)

const upload = core.getBooleanInput('upload')
const upload = core.getBooleanInput('upload')

if (upload) {
await getOctokit(process.env['GH_TOKEN']!).rest.issues.createComment({
owner: 'ahqstore',
repo: 'apps',
issue_number: 3,
body: `/store set ${value}`
})
}
})()
if (upload) {
await getOctokit(process.env['GH_TOKEN']!).rest.issues.createComment({
owner: 'ahqstore',
repo: 'apps',
issue_number: 3,
body: `/store set ${value}`
})
}
})()

0 comments on commit 72b1a59

Please sign in to comment.