Update #1
This file contains hidden or 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: Update | |
run-name: Update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 8 * * *" | |
jobs: | |
Check-Updates: | |
permissions: | |
issues: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Check updates | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: | | |
set -eu | |
title='[BOT] Update Dependencies' | |
message='' | |
if [ "$(gh issue list --json 'id' --jq length --state 'open' --search "${title}")" != '0' ]; then | |
echo 'Issue already exists, skipping...' | |
exit 0 | |
fi | |
pushd ./libfastjson | |
git fetch origin | |
if [ $(git rev-parse --verify origin/master) != $(git rev-parse --verify HEAD) ]; then | |
message="${message}- libfastjson is outdated"$'\n' | |
fi | |
popd | |
pushd ./libpatchelf/patchelf | |
git fetch origin | |
if [ $(git rev-parse --verify origin/master) != $(git rev-parse --verify HEAD) ]; then | |
message="${message}- patchelf is outdated"$'\n' | |
fi | |
popd | |
scripts/update-deps.py | |
if [ -n "$(git diff scripts/deps.sh)" ]; then | |
message="${message}- \`scripts/deps.sh\` is outdated"$'\n' | |
fi | |
if [ -n "${message}" ]; then | |
owner="$(gh repo view --json 'owner' --jq '.owner.login')" | |
gh issue create --assignee "${owner}" --title "${title}" --body "${message}" | |
fi |