Dependencies Update #4
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: Dependencies Update | |
on: | |
workflow_dispatch: | |
#schedule: | |
# - cron: "17 5 * * 1" | |
permissions: read-all | |
env: | |
BRANCH_NAME: autopr/dependencies_update | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: update branch | |
run: | | |
git checkout -B ${{ env.BRANCH_NAME }} | |
git reset origin/main --hard | |
- name: install tools | |
run: pip install --upgrade check-jsonschema | |
- name: setup go build environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
- name: dependency cache | |
uses: actions/cache@v4 | |
with: | |
path: $(go env GOPATH)/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: update dependencies | |
run: make updateall x GOPATH=$(go env GOPATH) | |
- name: commit changes | |
run: | | |
if [[ -n $(git status | grep -q '"git add"') ]]; then | |
git add . -A | |
git commit -m 'Automatic dependencies update' | |
git push origin ${{ env.BRANCH_NAME }} | |
sleep 5s | |
make versionup | |
git add . -A | |
git commit -m 'Update version' | |
git push origin ${{ env.BRANCH_NAME }} | |
fi | |
shell: bash |