Skip to content

Update dependencies #7362

Update dependencies

Update dependencies #7362

name: Update dependencies
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
env:
MOD_CLI_VERSION: '0.25.1'
jobs:
mod:
runs-on: ubuntu-latest
outputs:
error_message: ${{ steps.auto_merge.outputs.error_message}}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Login to Docker Hub
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ secrets.CW_DOCKER_HUB_USERNAME }}
password: ${{ secrets.CW_DOCKER_HUB_TOKEN }}
- name: Update dependencies
id: update_dependencies
run: |
curl -L https://github.com/variantdev/mod/releases/download/v${{ env.MOD_CLI_VERSION }}/mod_${{ env.MOD_CLI_VERSION }}_linux_amd64.tar.gz | tar xz
chmod +x ./mod
mkdir -p ~/bin
mv ./mod ~/bin/
git config --global user.email "${{ secrets.BOT_EMAIL }}"
git config --global user.name "CircleCI"
ls */variant.mod | xargs -I{} dirname {} | xargs -I{} /bin/bash -c 'cd {} && ~/bin/mod up --build --pull-request --base master --branch 'mod-up-{}' --title "[{}] update" --skip-on-duplicate-pull-request-title'
env:
GITHUB_TOKEN: ${{ secrets.SELF_GITHUB_TOKEN }}
- name: Notification failed
if: failure()
run: |
TITLE="Github Actions: Failed update dependencies (devil)"
BODY="Check the error from the following URL."
GITHUB_JOB_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
curl -sS -X POST -H "X-ChatWorkToken: ${{ secrets.CHATWORK_API_TOKEN }}" \
"https://api.chatwork.com/v2/rooms/${{ secrets.CHATWORK_NOTIFICATION_ROOM_ID }}/messages" \
--data-urlencode "body=[info][title]${TITLE}[/title]${BODY}[hr]${GITHUB_JOB_URL}[/info]"