Skip to content

Commit

Permalink
Update jekyll-gh-pages.yml
Browse files Browse the repository at this point in the history
Using xmlstarlet to edit sketch.rss pubDate and version as we do with sketch.json
  • Loading branch information
djKianoosh committed Sep 27, 2023
1 parent 06ae135 commit be3a4d2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,27 @@ jobs:
with:
# jq command with arguments
cmd: "jq -n --arg name \"CBP DS SKETCH LIBRARY.sketch\" --arg url \"https://github.com/US-CBP/cbp-ds-for-designers/raw/main/CBP%20DS%20SKETCH%20LIBRARY.sketch\" --arg dts \"$(date +%Y%m%d.%H%M%S)\" '{ itemName: $name, versionID: $dts, downloadURL: $url }' > sketch.json"

- name: Update sketch.rss version
uses: Mudlet/xmlstarlet-action@master
if: steps.check_file_changed.outputs.sketch_changed == 'True'
with:
args: ed -L --update '/rss/channel/item/enclosure/@sparkle:version' -v "$(date +%Y%m%d.%H%M%S)" sketch.rss

- name: Update sketch.rss pubDate
uses: Mudlet/xmlstarlet-action@master
if: steps.check_file_changed.outputs.sketch_changed == 'True'
with:
args: ed -L --update '/rss/channel/item/pubDate' -v "$(date)" sketch.rss

- name: Commit sketch.json
if: steps.check_file_changed.outputs.sketch_changed == 'True'
run: |
git config --global user.name 'GH Action'
git config --global user.email 'actions@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git add sketch.json
git commit -m "[skip ci] Update sketch.json (automated)"
git add sketch.*
git commit -m "[skip ci] Update sketch.(json,rss) timestamps (automated)"
git push
# Deployment job
Expand Down

0 comments on commit be3a4d2

Please sign in to comment.