Skip to content

Commit

Permalink
Implement action that returns desired maven goal
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanwh committed Nov 21, 2022
0 parents commit d835be3
Show file tree
Hide file tree
Showing 7 changed files with 10,298 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea

node_modules
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Set Revision javascript action

This action uses the github reference of the caller context,
and returns the desired Maven Revision property according to
our specification. This property is also
exported in the Github Environment as `REVISION`.
Our specification, in short, is as follows:
- Tags remain unchained
- Default branches are renamed to `latest`
- Non-default branches are appended with a `-SNAPSHOT` suffix

## Inputs

### acr

True if the application deploys docker images to Azure Container Registry using Jib, otherwise false.

### gpr

True if the application deploys JARs to Github Package Registry, otherwise false.

## Outputs

### `revision`

The appropriate `revision` value.
This value is also exported in the Github Environment as `REVISION`.

## Example usage

```yaml
uses: digipost/[email protected]
```
## Building this project
Make desired changes in `index.js` (and/or other files). Then run

```
ncc build index.js
```
to generate the dist/index.js file
## Links
- [Great guide for creating JavaScript Actions](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action)
- [Vercel NCC on Github](https://github.com/vercel/ncc)
17 changes: 17 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Set Maven Goals'
description: 'Exports a MVN_GOALS environment variable based on combination of input variables'
inputs:
acr:
description: True if the app deploys docker images to Azure Container Registry, otherwise false
required: false
default: 'false'
gpr:
description: True if the app deploys JARs to Github Package Registry using deploy, otherwise false
required: false
default: 'false'
outputs:
maven-goals:
description: 'The value of the maven goal variable'
runs:
using: 'node16'
main: 'dist/index.js'
Loading

0 comments on commit d835be3

Please sign in to comment.