Skip to content

Commit

Permalink
FAI-13390 - Support commit override (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
willmarks authored Oct 7, 2024
1 parent 76066c3 commit 5efdd3f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To report a code build to Faros specify `CI` in the `event` parameter and includ
```yaml
- name: Report code build to Faros
id: send-ci-event
uses: faros-ai/[email protected].9
uses: faros-ai/[email protected].10
with:
api-key: ${{ secrets.FAROS_API_KEY }}
event: CI
Expand All @@ -30,7 +30,7 @@ To report an artifact deployment to Faros specify `CD` in the `event` parameter
```yaml
- name: Report deployment to Faros
id: send-cd-event
uses: faros-ai/[email protected].9
uses: faros-ai/[email protected].10
with:
api-key: ${{ secrets.FAROS_API_KEY }}
event: CD
Expand All @@ -44,6 +44,27 @@ To report an artifact deployment to Faros specify `CD` in the `event` parameter
run-ended-at: 1594948069000 # millis since epoch, ISO-8601 string or 'Now'
```

### Report a code deployment (CD Event) To Faros with commit

To report the deployment of a commit to Faros specify `CD` in the `event` parameter and include the `CD` required fields.

```yaml
- name: Report deployment to Faros
id: send-cd-event
uses: faros-ai/[email protected]
with:
api-key: ${{ secrets.FAROS_API_KEY }}
event: CD
commit: GitHub://my-org/my-repo/sha
deploy: CodeDeploy://MyService/<env>/deploymentId # possible env values - Dev, Prod, Staging, QA
deploy-status: Success # possible values - Success, Failed, Canceled
deploy-started-at: 1594938057000 # millis since epoch, ISO-8601 string or 'Now'
deploy-ended-at: 1594938059000 # millis since epoch, ISO-8601 string or 'Now'
run-status: ${{ job.status }} # possible values - Success, Failed, Canceled
run-started-at: 1594938057000 # millis since epoch, ISO-8601 string or 'Now'
run-ended-at: 1594948069000 # millis since epoch, ISO-8601 string or 'Now'
```

## Authentication

Running the action requires a valid [Faros](https://www.faros.ai) account and [API key](https://docs.faros.ai/reference/getting-api-access).
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ inputs:
deploy-ended-at:
required: false
description: 'Deployment process end time in millis. (e.g. 1626804346019)'
commit-uri:
required: false
description: 'The URI of the commit that was built or deployed. (source://org/repo/sha)'
artifact:
required: false
description: 'The URI of the artifact that was built or deployed. (source://org/repo/artifact)'
Expand Down
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.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function resolveInput(): BaseEventInput {
const org = splitRepo[0];
const repo = splitRepo[1];
const sha = getEnvVar('GITHUB_SHA');
const commitUri = `GitHub://${org}/${repo}/${sha}`;
const commitUri = core.getInput('commit-uri') || `GitHub://${org}/${repo}/${sha}`;
const pullRequestNumber = core.getInput('pull-request-number');

// Construct run URI
Expand Down

0 comments on commit 5efdd3f

Please sign in to comment.