Skip to content

Commit

Permalink
FEAT: gh-action: Implement manifest change [2/2].
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Pacheco <[email protected]>
  • Loading branch information
MichaelPachec0 committed Nov 22, 2023
1 parent 7e4eaaf commit 3cf399c
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,42 @@ jobs:
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Check for manifest change
id: manifest
run: |
URL="https://api.github.com/repos/spicetify/spicetify-themes"
START=$(date -d 'yesterday' --utc --iso-8601=seconds)
END=$(date --utc --iso-8601=seconds)
LIST=$(curl -s "${URL}/commits?since=${START}&until=${END}" | jq -r '.[] | "\(.sha)"')
HEAD=$(echo "$LIST" | head -n 1)
TAIL=$(echo "$LIST" | tail -n 1)
FILES=$(curl -s "${URL}/compare/$TAIL...$HEAD" | jq -r '.files[].filename')
if [[ "$FILES" == *'manifest.json'* ]]; then
echo "check=true" >> "$GITHUB_OUTPUT"
else
echo "check=false" >> "$GITHUB_OUTPUT"
fi
- name: Download Manifest
uses: actions/checkout@v4
if: steps.manifest.outputs.check == 'true'
with:
repository: spicetify/spicetify-themes
path: themes

- name: Move Manifest
if: steps.manifest.outputs.check == 'true'
run: |
cp themes/manifest.json src/
- name: Update Manifest
uses: stefanzweifel/git-auto-commit-action@v4
if: steps.manifest.outputs.check == 'true'
with:
repository: src/
file_pattern: "manifest.json"
commit_message: "chore: Bump Manifest"

- name: Run nvfetcher
run: |
nix run github:berberman/nvfetcher -- -o src/pkgs/_sources -c src/pkgs/nvfetcher.toml
Expand Down

0 comments on commit 3cf399c

Please sign in to comment.