Skip to content

Commit

Permalink
ci: use temp variable for new extensions if any
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanouil committed Aug 4, 2024
1 parent bf8f042 commit 6848898
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/quarto-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ jobs:
| sed 's/path: https:\/\/github.com\///' > _quarto-web/quarto-web-extensions.csv
cat "${CSV_FILE}" | cut -d'/' -f1,2 > _quarto-web/quarto-extensions.csv
echo "Extensions from Quarto Website retrieved."
grep -Fvxi -f _quarto-web/quarto-extensions.csv _quarto-web/quarto-web-extensions.csv >> "${CSV_FILE}"
extensions_to_add=$(grep -Fvxi -f _quarto-web/quarto-extensions.csv _quarto-web/quarto-web-extensions.csv)
rm -rf _quarto-web
echo "Checking for new extensions to add."
diff=$(git diff "${CSV_FILE}")
if [[ -z "${diff}" ]]; then
if [[ -z "${extensions_to_add}" ]]; then
echo "No new extensions to add."
else
if git show-ref --quiet refs/heads/${{ env.BRANCH }}; then
Expand All @@ -48,6 +46,7 @@ jobs:
git push origin --delete "${{ env.BRANCH }}"
fi
git checkout -b "${{ env.BRANCH }}"
echo "${extensions_to_add}" >> "${CSV_FILE}"
git add "${CSV_FILE}"
git commit -m "${{ env.COMMIT }}"
git push --force origin ${{ env.BRANCH }}
Expand Down

0 comments on commit 6848898

Please sign in to comment.