Skip to content

Commit

Permalink
Add check on development.yml action for readme version
Browse files Browse the repository at this point in the history
  • Loading branch information
thejcpalma committed Mar 1, 2024
1 parent f947b7c commit 721b292
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,21 @@ jobs:
id: slug
run: echo "GIT_SHORT_SHA7=$(echo ${GITHUB_SHA} | cut -c1-7)" >> "$GITHUB_OUTPUT"

- name: Check README.md shield tag
id: check_shield_tag
run: |
if grep -q "readme-dev-blue" README.md; then
echo "The shield tag is already set to 'dev'. No update needed."
echo "{update_required}={false}" >> $GITHUB_OUTPUT
else
echo "The shield tag is not set to 'dev'. Proceeding with the update."
echo "{update_required}={true}" >> $GITHUB_OUTPUT
fi
shell: bash

# Defines the readme version to the dev tag
- name: Update README.md
if: steps.check_shield_tag.outputs.update_required == 'true'
run: |
echo "Changing README.md version to 'dev'."
sed "s/readme-\(.*\)-blue/readme-dev-blue/g" README.md > temp.md
Expand All @@ -64,6 +77,7 @@ jobs:
git push origin main
- name: Checkout after README.md update
if: steps.check_shield_tag.outputs.update_required == 'true'
uses: actions/checkout@v4

- name: Build and push
Expand Down

0 comments on commit 721b292

Please sign in to comment.