Skip to content

Commit

Permalink
use absolute path for BUILDEVENTS_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
sargunv committed Feb 26, 2021
1 parent 70cba09 commit 3c724c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Name | Required | Description |

Additionally, the following environment variable will be read:


`BUILDEVENT_FILE`: the path to a file containing additional key-value pairs. Data in this file will be attached to every span sent by buildevents. If this environment variable is not set, `gha-buildevents` will set this to a location outside the working directory.
When setting this environment variable, is recommended to set this [at the beginning of the workflow](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#env).

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5447,7 +5447,7 @@ function addFields(keyValueMap) {
const BUILDEVENT_FILE = 'BUILDEVENT_FILE';
let envPath = util.getEnv(BUILDEVENT_FILE);
if (!envPath) {
envPath = '../buildevents.txt';
envPath = path.resolve('../buildevents.txt');
util.setEnv(BUILDEVENT_FILE, envPath);
}
// Add the existing values from the BUILDEVENT_FILE to the fields we write out
Expand Down
2 changes: 1 addition & 1 deletion src/buildevents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function addFields(keyValueMap: object): void {

let envPath = util.getEnv(BUILDEVENT_FILE)
if (!envPath) {
envPath = '../buildevents.txt'
envPath = path.resolve('../buildevents.txt')
util.setEnv(BUILDEVENT_FILE, envPath)
}
// Add the existing values from the BUILDEVENT_FILE to the fields we write out
Expand Down

0 comments on commit 3c724c5

Please sign in to comment.