Skip to content

Commit

Permalink
Merge pull request #7 from newrelic/feat/test-the-action
Browse files Browse the repository at this point in the history
fix: wrap github.actor context in quotes, update example, add test for action
  • Loading branch information
sanderblue authored May 21, 2020
2 parents 2b77662 + 011fe60 commit dfd32bc
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on: [push]

jobs:
new_relic:
runs-on: ubuntu-latest
name: New Relic Deployment Marker GitHub Action
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-test-${{ github.sha }}"
user: "${{ github.actor }}" # optional
region: US # optional
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }} # optional
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ A GitHub Action to add New Relic deployment markers during your release pipeline
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `apiKey` | required | Your New Relic [personal API key](https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#personal-api-key). |
| `applicationId` | required | The New Relic application ID to apply the deployment marker. |
| `region` | optional | The region of your New Relic account. Default: "US" |
| `revision` | optional | Metadata to apply to the deployment marker - e.g. the latest release tag |
| `revision` | required | Metadata to apply to the deployment marker - e.g. the latest release tag |
| `user` | optional | The user creating the deployment. Default: `github.actor` |
| `region` | optional | The region of your New Relic account. Default: `US` |
| `accountId` | optional | The account number the application falls under. This could also be a subaccount. |
| `user` | optional | The user creating the deployment. Default: ${{ github.actor }} |

## Example usage

Expand All @@ -32,8 +32,8 @@ jobs:
with:
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: <your application ID>
revision: ${{ github.ref }}-${{ github.sha }} # optional
region: US # optional
accountId: <your New Relic account ID> # optional
user: ${{ github.actor }} # optional
revision: "${{ github.ref }}-${{ github.sha }}"
user: "${{ github.actor }}" # optional
region: US # optional
accountId: <your New Relic account ID> # optional
```
6 changes: 3 additions & 3 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ inputs:
required: true
revision:
description: 'Custom revision information to add to the deployment marker - e.g. the latest tag.'
required: false
required: true
accountId:
description: 'Your New Relic account ID. This account ID should have access to the specified application.'
required: false
user:
description: 'The user creating the deployment. Default: ${{ github.actor }}'
description: 'The user creating the deployment. Default: `github.actor`'
required: false
default: ${{ github.actor }}
default: '${{ github.actor }}'
runs:
using: 'docker'
image: 'Dockerfile'
Expand Down
2 changes: 0 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
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=$?
Expand Down

0 comments on commit dfd32bc

Please sign in to comment.