Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency ts-jest to v27.0.7 #12

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: action test
zhiqingchen committed Nov 8, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 9211f28165c9b5917e079145ae229f5f6d746824
3 changes: 1 addition & 2 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {test} from '@jest/globals'

test('test runs', () => {
})
test('test runs', () => {})
15 changes: 12 additions & 3 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -2,13 +2,15 @@ import * as core from '@actions/core'
import * as exec from '@actions/exec'
import * as github from '@actions/github'
import * as io from '@actions/io'
import * as path from 'path'
import QRCode from 'qrcode'

export async function run(): Promise<void> {
try {
// 0. get params from workflow
const env = process.env
core.info(`env: ${env}`)
let workspace = env['GITHUB_WORKSPACE']
core.info(`env: ${JSON.stringify(env)}`)
const respository = env['GITHUB_REPOSITORY']
const ref = env['GITHUB_REF']
const payload = JSON.stringify(github.context.payload, undefined, 2)
@@ -21,6 +23,15 @@ export async function run(): Promise<void> {
const appName = core.getInput('APPNAME') || ''
const logo = core.getInput('LOGO') || ''

if (!workspace) {
throw new Error('GITHUB_WORKSPACE not defined')
}
workspace = path.resolve(workspace)
core.debug(`GITHUB_WORKSPACE = '${workspace}'`)

const lsPath = await io.which('ls', true)
await execDebug(lsPath)

// 1. install node modules
let yarnPath = 'yarn'
try {
@@ -70,8 +81,8 @@ export async function run(): Promise<void> {
}
}

function genQr(text: string, path: string): void {
const QR_CODE_PNG_PATH = `${process.cwd()}/${path}`
function genQr(text: string, dist: string): void {
const QR_CODE_PNG_PATH = `${process.cwd()}/${dist}`
QRCode.toFile(QR_CODE_PNG_PATH, text, {type: 'png'}, err => {
if (err) throw err
core.info(`generated: ${text} to ${path}`)
Loading