-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional debugging to troubleshoot actions issues (#18)
- Loading branch information
Showing
7 changed files
with
83 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'The version tag of the release. This should match version in package.json and start with `v`. For example: `v1.0.0`' | ||
required: true | ||
branch: | ||
description: 'The major version branch to commit to. Default v1.' | ||
default: v1 | ||
required: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12 | ||
cache: yarn | ||
- name: Install | ||
run: yarn --prefer-offline --frozen-lockfile --no-progress --non-interactive | ||
- name: Lint | ||
run: yarn lint | ||
- name: Build | ||
run: yarn build | ||
- name: Test | ||
run: yarn test | ||
- name: Commit | ||
uses: endbug/add-and-commit@45a4ede867982d5d85997a82529b1d9dd0328e7f | ||
with: | ||
add: 'build --force' | ||
branch: ${{ github.event.inputs.branch }} | ||
message: 'Add build output' | ||
pull: 'NO-PULL' | ||
push: 'origin ${{ github.event.inputs.branch }} --force' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Tag | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
body: 'TODO: Add CHANGELOG entry' | ||
tag: ${{ github.event.inputs.tag }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "apollo-schema-check-action", | ||
"description": "A GitHub Action to run a schema check and post the results as a comment on a Pull Request", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"author": "Ian Sutherland <[email protected]>", | ||
"license": "MIT", | ||
"repository": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import execa from 'execa'; | ||
|
||
import { debug } from './actions'; | ||
import { debug, info, error as logError } from './actions'; | ||
import { getArguments } from './get-arguments'; | ||
import { formatMessage } from './format-message'; | ||
|
||
|
@@ -18,15 +18,12 @@ const getMessage = async ( | |
arg.startsWith('--key') ? arg.replace(/:[^:]+$/, '***') : arg | ||
); | ||
|
||
console.log( | ||
'Apollo CLI command', | ||
['npx', '[email protected]', 'schema:check', ...redactedArgs].join(' ') | ||
); | ||
info('Apollo CLI command', ['npx', '[email protected]', 'schema:check', ...redactedArgs].join(' ')); | ||
|
||
try { | ||
const output = (await execa('npx', ['[email protected]', 'schema:check', ...args])).stdout; | ||
|
||
console.log(output); | ||
info(output); | ||
|
||
const message = formatMessage(output, existingComment); | ||
|
||
|
@@ -37,11 +34,11 @@ const getMessage = async ( | |
} | ||
} catch (error) { | ||
if (error.exitCode !== 1) { | ||
console.error(`Apollo CLI error: exit code ${error.exitCode}`, error); | ||
logError(`Apollo CLI error: exit code ${error.exitCode}`, error); | ||
|
||
throw new Error('Error running Apollo CLI'); | ||
} else { | ||
console.log(error.stdout); | ||
info(error.stdout); | ||
|
||
const message = formatMessage(error.stdout, existingComment); | ||
|
||
|