Updates #447
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Updates | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
inputs: | |
force: | |
description: "Enter 'force' if you want to force a refresh" | |
required: false | |
default: "" | |
jobs: | |
excavate: | |
name: Excavator | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@main | |
- name: Excavate | |
uses: ScoopInstaller/GithubActions@main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SKIP_UPDATED: 1 | |
update: | |
name: Autoupdate | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@main | |
- name: Update manifests | |
uses: foosel/scoop-checkver-action@main | |
with: | |
bucket: bucket | |
force: ${{ github.event.inputs.force }} | |
- name: Deploy changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
while read file; do | |
if [[ $file == bucket/* ]] && [[ $file == *.json ]]; then | |
version=$(cat $file | jq -r .version) | |
manifest=$(basename $file .json) | |
message="$manifest: Update to version $version" | |
git add "$file" | |
git commit -m "$message" | |
fi | |
done < <(git diff --name-only) | |
git push |