-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from newrelic/jthurman/errormsg
[Fix] Update error handling for Actions
- Loading branch information
Showing
5 changed files
with
82 additions
and
24 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
basic_test: | ||
runs-on: ubuntu-latest | ||
name: Release marker example | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set Release Version from Tag | ||
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF:10} | ||
|
||
- name: Test deployment marker | ||
uses: ./ | ||
with: | ||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }} | ||
applicationId: ${{ secrets.APPLICATION_ID }} | ||
revision: "deployment-marker-action-release:${{ env.RELEASE_VERSION }}" | ||
|
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,54 @@ | ||
name: Test Suite | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
# should_fail_test: | ||
# runs-on: ubuntu-latest | ||
# name: Should Fail Test | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v2 | ||
# | ||
# - name: Test deployment marker | ||
# uses: ./ | ||
# with: | ||
# apiKey: ${{ secrets.NEW_RELIC_API_KEY }} | ||
# applicationId: 0 | ||
# revision: "deployment-marker-action-should-fail-test:${{ github.ref }}" | ||
|
||
basic_test: | ||
runs-on: ubuntu-latest | ||
name: Basic Usage Test | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test deployment marker | ||
uses: ./ | ||
with: | ||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }} | ||
applicationId: ${{ secrets.APPLICATION_ID }} | ||
revision: "deployment-marker-action-basic-test:${{ github.ref }}" | ||
|
||
all_inputs_test: | ||
runs-on: ubuntu-latest | ||
name: All Inputs Test | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test deployment marker | ||
uses: ./ | ||
with: | ||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }} | ||
applicationId: ${{ secrets.APPLICATION_ID }} | ||
revision: "deployment-marker-action-all-input-test-${{ github.sha }}" | ||
user: "hardcoded-test-username" # optional | ||
region: US # optional | ||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }} # optional | ||
|
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,14 +1,11 @@ | ||
#!/bin/sh | ||
|
||
RED='\033[0;31m' | ||
NO_COLOR='\033[0m' | ||
|
||
result=$(newrelic apm deployment create --applicationId "${APPLICATION_ID}" --revision "${REVISION}" --accountId "${NEW_RELIC_ACCOUNT_ID}" --user "${NEW_RELIC_DEPLOYMENT_USER}" 2>&1) | ||
|
||
exitStatus=$? | ||
|
||
if [ $exitStatus -ne 0 ]; then | ||
printf "${RED}Error:${NO_COLOR} $result" | ||
echo "::error:: $result" | ||
fi | ||
|
||
exit $exitStatus |