Dependencies #91
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 | |
on: | |
schedule: | |
- cron: "0 3 * * 0" # https://crontab.guru/#0_3_*_*_0 | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: upgrade-deps | |
cancel-in-progress: true | |
permissions: | |
# NOTES: Needed for create dependencies upgrade PR | |
pull-requests: write | |
env: | |
PULL_REQUEST_TITLE: "fix(deps): upgrade dependencies [auto]" | |
COMMIT_MESSAGE: "fix(deps): upgrade dependencies [auto]" | |
CHANGE_MESSAGE: upgrade dependencies [auto] | |
CHANGE_TYPE: minor | |
jobs: | |
upgrading: | |
runs-on: ubuntu-latest | |
environment: | |
name: github | |
url: ${{ steps.create-pr.outputs.url }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Setup git | |
uses: ./.github/actions/setup-git | |
with: | |
git-email: ${{ secrets.GIT_EMAIL }} | |
git-username: ${{ secrets.GIT_USERNAME }} | |
github-token: ${{ secrets.GH_TOKEN }} | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY_BASE64 }} | |
gpg-fingerprint: ${{ secrets.GPG_FINGERPRINT }} | |
- name: Setup rushjs | |
uses: ./.github/actions/setup-rush | |
- name: Update dependencies | |
uses: ./.github/actions/run-rush | |
with: | |
command: upgrade | |
- name: Upgrade autoinstaller [rush-api-documenter] | |
uses: ./.github/actions/run-rush | |
with: | |
command: update-autoinstaller | |
args: --name "rush-api-documenter" | |
- name: Upgrade autoinstaller [rush-dependencies-updater] | |
uses: ./.github/actions/run-rush | |
with: | |
command: update-autoinstaller | |
args: --name "rush-dependencies-updater" | |
- name: Upgrade autoinstaller [rush-lintstaged] | |
uses: ./.github/actions/run-rush | |
with: | |
command: update-autoinstaller | |
args: --name "rush-lintstaged" | |
- name: Upgrade autoinstaller [rush-commitlint] | |
uses: ./.github/actions/run-rush | |
with: | |
command: update-autoinstaller | |
args: --name "rush-commitlint" | |
- name: Upgrade dependencies | |
uses: ./.github/actions/run-rush | |
with: | |
command: update | |
args: > | |
--full | |
--purge | |
--recheck | |
- name: Build libraries for git hooks | |
uses: ./.github/actions/run-rush | |
with: | |
command: build | |
args: --to @kcws/lintstaged-config | |
- name: Commit changes | |
run: git commit --all --message "${{ env.COMMIT_MESSAGE }}" | |
- name: Generate changesfile | |
uses: ./.github/actions/run-rush | |
with: | |
command: change | |
args: > | |
--commit | |
--email "${{ secrets.GIT_EMAIL }}" | |
--bulk | |
--message "${{ env.CHANGE_MESSAGE }}" | |
--bump-type "${{ env.CHANGE_TYPE }}" | |
- name: Create pull request | |
id: create-pr | |
uses: ./.github/actions/create-pr | |
with: | |
github-token: ${{ secrets.GH_TOKEN }} | |
title: ${{ env.PULL_REQUEST_TITLE }} | |
branch-prefix: deps | |
- name: Cleanup git | |
if: always() | |
uses: ./.github/actions/cleanup-git | |
with: | |
gpg-fingerprint: ${{ secrets.GPG_FINGERPRINT }} |