ci: fix the Sync workflow (#117)

Co-authored-by: Maël Nison <nison.mael@gmail.com>
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
This commit is contained in:
Antoine du Hamel 2022-06-02 00:47:26 +02:00 committed by GitHub
parent fb09145610
commit e810142ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 15 deletions

View File

@ -3,7 +3,8 @@ name: Version Sync
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
# Run once a week at 00:05 UTC on Sunday.
- cron: 5 0 * * 0
jobs:
build:
@ -15,7 +16,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: lts/*
- name: "Update the package manager versions"
run: |
@ -24,7 +25,7 @@ jobs:
LATEST_YARN=$(curl https://registry.npmjs.org/yarn | jq '.["dist-tags"].latest')
LATEST_BERRY=$(curl https://repo.yarnpkg.com/tags | jq '.latest.stable')
jq < config.json > config.json.new '. * '"{
git --no-pager show HEAD:config.json | jq '. * '"{
definitions: {
npm: {
default: $LATEST_NPM,
@ -39,16 +40,15 @@ jobs:
},
},
},
}"
}" > config.json
rm config.json
mv config.json.new config.json
if [[ ! -z "$(git status --porcelain)" ]]; then
git config user.email 'github-bot@iojs.org'
git config user.name 'Node.js GitHub Bot'
git add config.json
git commit -m 'chore: update package manager versions'
git push
fi
- uses: gr2m/create-or-update-pull-request-action@466b1b84c3291c6c69bc56377a6de54a1f4a297c
# Creates a PR or update the Action's existing PR, or
# no-op if the base branch is already up-to-date.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: This is an automated update of package manager versions
branch: actions/tools-update-config.json
commit-message: "chore: update package manager versions"
title: "chore: update package manager versions"