Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,26 @@ jobs:
git config --global user.email "test@test.com"
git config --global user.name "test"
make test

action-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.head_ref }} # checkout the correct branch name
fetch-depth: 0 # fetch the whole repo history

- id: version
uses: ./
with:
skip-prerelease: true
major-identifier: "BREAKING CHANGE:"
minor-identifier: "feat:"
prefix: "v"

- name: New version
run: |
echo ${{ steps.version.outputs.version }}
- name: Previous version
run: |
echo ${{ steps.version.outputs.previous-version }}
14 changes: 10 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,21 @@ runs:
using: "composite"
steps:
- shell: bash
env:
GH_TOKEN: ${{ github.token }}
TOOL_VERSION: ${{ inputs.tool-version }}
run: |
set -eo pipefail
if [ "${{ inputs.tool-version }}" = "latest" ]; then
download_url="$(curl -Ls https://api.github.com/repos/linz/action-git-version/releases/latest | jq -r .assets[0].browser_download_url)"
if [ "$TOOL_VERSION" = "latest" ]; then
download_url="$(gh release view --repo linz/action-git-version --json assets | jq -r .assets[0].url)"
else
download_url="https://github.com/linz/action-git-version/releases/download/${{ inputs.tool-version }}/git-version"
download_url="https://github.com/linz/action-git-version/releases/download/$TOOL_VERSION/git-version"
fi
sudo curl -Ls "$download_url" -o /usr/local/bin/git-version

echo "Downloading git-version from $download_url"
sudo curl --retry 3 -L "$download_url" -o /usr/local/bin/git-version
sudo chmod +x /usr/local/bin/git-version

- id: previous-version
shell: bash
run: |
Expand Down