Skip to content

Commit

Permalink
fix: check_changes.yaml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and ialejandro committed Jul 18, 2024
1 parent 46abfe9 commit 60c34b2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/check_changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,30 @@ jobs:
with:
python-version: '3.x'

- name: Read values
- name: Get latest tag
id: latest_tag
run: |
# latest
latest_tag=$(curl -s https://api.github.com/repos/linkedin/cruise-control/tags | jq -r '.[0].name')
echo "LATEST_TAG=$latest_tag" >> $GITHUB_OUTPUT
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
- name: Get current tag
id: current_tag
run: |
# current
current_tag=$(grep lastTag .lastbuild | cut -d '=' -f 2)
echo "CURRENT_TAG=$current_tag" >> $GITHUB_OUTPUT
echo "current_tag=$current_tag" >> $GITHUB_OUTPUT
- name: Check if exists changes
id: check_changes
run: |
# check changes
if [ $LATEST_TAG != $CURRENT_TAG ]; then
if [ ${{ steps.latest_tag.outputs.latest_tag }} != ${{ steps.current_tag.outputs.current_tag }} ]; then
echo "tag_changed=true" >> $GITHUB_OUTPUT
fi
# save file
echo "lastTag=$new_tag" >> .lastbuild
echo "lastTag=$new_tag" > .lastbuild
- name: Update .lastbuild file
if: steps.check_changes.outputs.tag_changed == 'true'
Expand Down

0 comments on commit 60c34b2

Please sign in to comment.