Update nginx-redirect release: v0.2.0 #7
Workflow file for this run
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
name: Update Version | |
on: | |
push: | |
branches: | |
- 'releases/*/v*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install yq | |
uses: mikefarah/yq@v4.44.6 | |
- name: Configure chart version | |
id: chart_meta | |
run: | | |
cat >> "$GITHUB_OUTPUT" <<EOF | |
chart_name=$(cut -d / -f 4 <<<"${{ github.ref }}") | |
chart_version=$(cut -d / -f 5- <<<"${{ github.ref }}") | |
EOF | |
- name: Update chart version | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" | |
chart_file="${{ steps.chart_meta.outputs.chart_name }}/Chart.yaml" | |
yq '.version = "${{ steps.chart_meta.outputs.chart_version }}"' \ | |
"${chart_file}" > "${chart_file}.updated" | |
if ! diff -q "${chart_file}" "${chart_file}.updated"; then | |
mv -f "${chart_file}.updated" "${chart_file}" | |
fi | |
if ! git --no-pager diff --exit-code; then | |
git commit -a -m 'chart version updated' | |
fi | |
make helm-docs | |
if ! git --no-pager diff --exit-code; then | |
git commit -a -m 'chart docs updated' | |
fi | |
if ! git --no-pager diff --exit-code "origin/${{ github.ref_name }}"..HEAD; then | |
git push origin "${{ github.ref_name }}" | |
fi |