mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-07-06 03:54:54 +00:00
Add github action entrypoint.
This commit is contained in:
@@ -175,6 +175,7 @@ jobs:
|
|||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
|
|||||||
+1
-1
@@ -13,5 +13,5 @@ RUN apk add --no-cache ca-certificates
|
|||||||
WORKDIR /go/src/app
|
WORKDIR /go/src/app
|
||||||
COPY --from=baseimg /go/src/app/semver-gen .
|
COPY --from=baseimg /go/src/app/semver-gen .
|
||||||
COPY --from=baseimg /go/src/app/config-release.yaml config.yaml
|
COPY --from=baseimg /go/src/app/config-release.yaml config.yaml
|
||||||
|
COPY entrypoint.sh entrypoint.sh
|
||||||
CMD ["./semver-gen"]
|
CMD ["./semver-gen"]
|
||||||
+4
-3
@@ -19,6 +19,7 @@ runs:
|
|||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
args:
|
args:
|
||||||
- ${{ inputs.config-file }}
|
- generate
|
||||||
- ${{ inputs.repository-url }}
|
- ${{ inputs.config_file }}
|
||||||
- ${{ inputs.repository-local }}
|
- ${{ inputs.repository_url }}
|
||||||
|
- ${{ inputs.repository_local }}
|
||||||
Regular → Executable
+26
-2
@@ -1,5 +1,29 @@
|
|||||||
#!/bin/sh -l
|
#!/bin/sh -l
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
echo "Hello $1"
|
FLAGS=""
|
||||||
|
|
||||||
echo "::set-output name=semver::$time"
|
if [[ -z "$INPUT_CONFIG_FILE" ]]; then
|
||||||
|
echo "Set the configuration file path."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
FLAGS+=" -c $INPUT_CONFIG_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$INPUT_REPOSITORY_URL" ]] && [[ -z "$INPUT_REPOSITORY_LOCAL" ]];
|
||||||
|
then
|
||||||
|
echo "You need to set either remote repository or repository local flags."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$INPUT_REPOSITORY_URL" ]]; then
|
||||||
|
FLAGS+=" -r $INPUT_REPOSITORY_URL"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$INPUT_REPOSITORY_LOCAL" ]]; then
|
||||||
|
FLAGS+=" -l"
|
||||||
|
fi
|
||||||
|
|
||||||
|
OUT_SEMVER_GEN=$(./semver-gen generate generate $FLAGS)
|
||||||
|
OUT_SEMVER=$(echo $OUT_SEMVER_GEN | sed -e 's|SEMVER ||g')
|
||||||
|
echo "::set-output name=semver::$OUT_SEMVER"
|
||||||
Reference in New Issue
Block a user