Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix the Sync workflow #117

Merged
merged 3 commits into from
Jun 1, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Version Sync
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
# Run once a week at 00:05 AM UTC on Sunday.
aduh95 marked this conversation as resolved.
Show resolved Hide resolved
- cron: 5 0 * * 0

jobs:
build:
Expand All @@ -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: |
Expand All @@ -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,
Expand All @@ -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 '[email protected]'
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"