@@ -100,53 +100,5 @@ jobs:
100100 ref : main
101101 fetch-depth : 0
102102
103- - name : Check if app is in version history
104- id : check_version
105- run : |
106- if jq -e '.["pdfix-actions"][] | select(.name == "${{ env.ACTION_NAMESPACE }}/${{ env.ACTION_REPOSITORY }}")' pdfix-version-updates/v1/versions.json > /dev/null; then
107- echo "has_version_history=true" >> $GITHUB_OUTPUT
108- else
109- echo "App not found in version history. Skipping update steps."
110- echo "has_version_history=false" >> $GITHUB_OUTPUT
111- fi
112-
113- - name : Update action version and date in versions repository
114- if : steps.check_version.outputs.has_version_history == 'true'
115- run : |
116- cd pdfix-version-updates/v1
117- TODAY=$(date +%Y-%m-%d)
118- jq --indent 4 '(.["pdfix-actions"][] | select(.name == "${{ env.ACTION_NAMESPACE }}/${{ env.ACTION_REPOSITORY }}")) |= . + {
119- "version": "${{ env.tag }}",
120- "release_date": "'"$TODAY"'"
121- }' versions.json > tmp.json
122- mv tmp.json versions.json
123- cat versions.json
124-
125- - name : Commit and Push changes into versions repository
126- if : steps.check_version.outputs.has_version_history == 'true'
127- run : |
128- cd pdfix-version-updates
129- git config user.name "PDFix Support"
130- git config user.email "support@pdfix.net"
131- git add v1/versions.json
132- git commit -m "${{ env.ACTION_NAMESPACE }}/${{ env.ACTION_REPOSITORY }} ${{ env.tag }}"
133- git push
134-
135- - name : Tag latest commit with increment in versions repository
136- if : steps.check_version.outputs.has_version_history == 'true'
137- run : |
138- cd pdfix-version-updates
139- git pull
140- if git describe --exact-match --tags HEAD > /dev/null 2>&1; then
141- echo "HEAD already has a tag — skipping tagging."
142- else
143- latest_tag=$(git tag -l "v*.*.*" | sort -V | tail -n 1)
144- echo "Latest tag is: $latest_tag"
145- version=${latest_tag#v}
146- IFS='.' read -r major minor patch <<< "$version"
147- patch=$((patch + 1))
148- new_tag="v$major.$minor.$patch"
149- git tag -a "$new_tag" -m "Release $new_tag"
150- git push origin "$new_tag"
151- echo "Tagged HEAD with: $new_tag"
152- fi
103+ - name : Update versions repository with new version
104+ run : chmod +x update_versions_repository.sh && ./update_versions_repository.sh ${{ env.ACTION_NAMESPACE }} ${{ env.ACTION_REPOSITORY }} ${{ env.tag }}
0 commit comments