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