Dependencies Workflow #67
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 Workflow | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 15 * * 5' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
yarn: | |
name: Bump Yarn | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_AUTHOR_NAME: 'github-actions[bot]' | |
GIT_AUTHOR_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com' | |
GIT_COMMITTER_NAME: 'github-actions[bot]' | |
GIT_COMMITTER_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com' | |
YARN_ENABLE_IMMUTABLE_INSTALLS : 'false' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Enable Corepack | |
run: | | |
corepack enable | |
- name: Update version | |
run: | | |
old_version=$(yarn --version) | |
yarn set version latest | |
new_version=$(yarn --version) | |
if git diff --exit-code &> /dev/null; then | |
exit 0 | |
fi | |
yarn | |
title="Bump yarn from $old_version to $new_version" | |
body="Bumps yarn from $old_version to $new_version" | |
git checkout -b "dependencies/yarn/yarn-$new_version" | |
git add package.json yarn.lock .yarnrc.yml .yarn/ | |
git commit --message="$title" | |
git push origin HEAD | |
gh pr create --base=master --title="$title" --body="$body" |