This repository has been archived by the owner on Jan 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0d3d5ce
Showing
3 changed files
with
42 additions
and
0 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,11 @@ | ||
# versioning-action | ||
|
||
Action created for easier versioning in trunk-based flow | ||
|
||
Parameters: | ||
- `github_info` - `github` context of build | ||
- `gist_token` - Github personal API token with `gist` scope (acts like back-end) | ||
|
||
Outputs: | ||
- step output `version` | ||
- environment variable `VERSION` which will be available in flow |
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,15 @@ | ||
name: Versioner | ||
|
||
inputs: | ||
github_info: | ||
required: true | ||
gist_token: | ||
required: true | ||
|
||
outputs: | ||
version: | ||
description: generated version | ||
|
||
runs: | ||
using: 'node12' | ||
main: 'app.js' |
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,16 @@ | ||
const { env } = process; | ||
|
||
const GITHUB_CONTEXT = JSON.parse(env.INPUT_GITHUB_INFO) | ||
const GIST_TOKEN = env.INPUT_GIST_TOKEN | ||
|
||
const { event_name: eventName } = GITHUB_CONTEXT; | ||
|
||
switch (eventName) { | ||
case 'pull_request': | ||
pullRequestAction(GITHUB_CONTEXT); | ||
} | ||
|
||
|
||
function pullRequestAction(context) { | ||
console.log('This is PR : ', context.event.number); | ||
} |