Skip to content

Commit

Permalink
fix: variable interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
M0NsTeRRR committed Jul 29, 2024
1 parent 94f832c commit 0ea4d24
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
11 changes: 10 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,29 @@ inputs:
outputs:
changelog:
description: "output file"
value: ${{ steps.run-git-cliff.outputs.changelog }}
content:
description: "content of the changelog"
value: ${{ steps.run-git-cliff.outputs.content }}
version:
description: "version of the latest release"
value: ${{ steps.run-git-cliff.outputs.version }}
runs:
using: "composite"
steps:
- name: Download git-cliff
shell: bash
run: ${{ github.action_path }}/install.sh
env:
RUNNER_OS: ${{ runner.os }}
RUNNER_ARCH: ${{ runner.arch }}
VERSION: ${{ inputs.version }}
GITHUB_TOKEN: ${{ github.token }}

- name: Run git-cliff
id: run-git-cliff
shell: bash
run: ${{ github.action_path }}/run.sh
run: ${{ github.action_path }}/run.sh --config=${{ inputs.config }} ${{ inputs.args }}

branding:
icon: "triangle"
Expand Down
10 changes: 5 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

set -uxo pipefail

case "${{ runner.os }}" in
case "${RUNNER_OS}" in
macOS) OS=apple-darwin ;;
Windows) OS=pc-windows-msvc ;;
*) OS=unknown-linux-gnu ;;
esac
case "${{ runner.arch }}" in
case "${RUNNER_ARCH}" in
ARM64) ARCH=aarch64 ;;
ARM) ARCH=pc-windows-msvc ;;
X86) ARCH=i686 ;;
*) ARCH=x86_64 ;;
esac

RELEASE_URL='https://api.github.com/repos/orhun/git-cliff/releases/latest'
if [[ "${{ inputs.version }}" != "latest" ]]; then
RELEASE_URL='https://api.github.com/repos/orhun/git-cliff/releases/tags/${{ inputs.version }}'
if [[ "${VERSION}" != "latest" ]]; then
RELEASE_URL='https://api.github.com/repos/orhun/git-cliff/releases/tags/${VERSION}'
fi

# Although releases endpoint is available without authentication, the current github.token is still passed
# in order to increase the limit of 60 requests per hour per IP address to a higher value that's also counted
# per GitHub account.
# Caching is disabled in order not to receive stale responses from Varnish cache fronting GitHub API.
RELEASE_INFO="$(curl --silent --show-error --fail \
--header 'authorization: Bearer ${{ github.token }}' \
--header 'authorization: Bearer ${GITHUB_TOKEN}' \
--header 'Cache-Control: no-cache, must-revalidate' \
"${RELEASE_URL}")"
TAG_NAME="$(echo "${RELEASE_INFO}" | jq --raw-output ".tag_name")"
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -l
#!/bin/bash

set -uxo pipefail

Expand Down

0 comments on commit 0ea4d24

Please sign in to comment.