From e810142ede2f9ed2c5be7e9bccab93fd06c7ebb6 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 2 Jun 2022 00:47:26 +0200 Subject: [PATCH] ci: fix the Sync workflow (#117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Maƫl Nison Co-authored-by: Kristoffer K. --- .github/workflows/sync.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 8702e2e..b4108e9 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -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"