2023-02-24 15:52:43 +00:00
|
|
|
name: "Nightly"
|
2021-12-13 21:04:21 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2023-05-16 13:35:06 +00:00
|
|
|
# Run every Monday at 12:00 UTC
|
|
|
|
- cron: "0 12 * * 1"
|
2021-12-14 16:47:00 +00:00
|
|
|
workflow_dispatch:
|
2021-12-13 21:04:21 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
stat:
|
2023-05-16 13:35:06 +00:00
|
|
|
# Temporarily disable since stat collection hasn't work for a while
|
|
|
|
if: false
|
2021-12-13 21:04:21 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out code using Git
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-03-08 21:46:11 +00:00
|
|
|
|
2022-10-28 18:36:50 +00:00
|
|
|
- name: Setup PNPM
|
2023-02-24 15:52:43 +00:00
|
|
|
uses: pnpm/action-setup@v2
|
2022-10-28 18:36:50 +00:00
|
|
|
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 16
|
2023-02-24 15:52:43 +00:00
|
|
|
cache: "pnpm"
|
2022-10-28 18:36:50 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
2022-03-08 21:46:11 +00:00
|
|
|
|
2021-12-13 21:04:21 +00:00
|
|
|
- name: Collect stats
|
|
|
|
run: node scripts/stats/index.js
|
|
|
|
env:
|
2023-02-24 15:52:43 +00:00
|
|
|
# Needs access to collect stats from the GitHub API
|
2022-06-27 18:02:44 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
|
|
|
|
|
2021-12-13 21:04:21 +00:00
|
|
|
- name: Commit changes
|
|
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
|
|
with:
|
2023-02-24 15:52:43 +00:00
|
|
|
commit_message: "[ci] collect stats"
|
2021-12-13 21:04:21 +00:00
|
|
|
branch: ${{ github.head_ref }}
|
2022-06-27 18:02:44 +00:00
|
|
|
# Needs access to push to main
|
|
|
|
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
|
2021-12-13 21:04:21 +00:00
|
|
|
|
|
|
|
lockfile:
|
|
|
|
if: github.repository_owner == 'withastro'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out code using Git
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2022-10-28 18:36:50 +00:00
|
|
|
- name: Setup PNPM
|
2023-02-24 15:52:43 +00:00
|
|
|
uses: pnpm/action-setup@v2
|
2022-10-28 18:36:50 +00:00
|
|
|
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
2021-12-13 21:04:21 +00:00
|
|
|
with:
|
2022-10-28 18:36:50 +00:00
|
|
|
node-version: 16
|
2023-02-24 15:52:43 +00:00
|
|
|
cache: "pnpm"
|
2022-03-09 16:12:12 +00:00
|
|
|
|
2022-06-29 21:54:40 +00:00
|
|
|
- name: Delete the existing pnpm-lock.yaml file
|
|
|
|
run: rm pnpm-lock.yaml
|
|
|
|
|
2023-05-16 13:35:06 +00:00
|
|
|
# https://github.com/pnpm/pnpm/issues/6463
|
|
|
|
- name: Update .npmrc to update packages to latest
|
|
|
|
run: echo "resolution-mode=highest" >> .npmrc
|
|
|
|
|
2022-06-29 21:54:40 +00:00
|
|
|
- name: Create a fresh pnpm lockfile (no install)
|
|
|
|
run: pnpm install --lockfile-only
|
2022-03-09 16:12:12 +00:00
|
|
|
|
2021-12-13 21:04:21 +00:00
|
|
|
- name: Create Pull Request
|
|
|
|
id: createpr
|
2023-05-16 13:35:06 +00:00
|
|
|
uses: peter-evans/create-pull-request@v5
|
2021-12-13 21:04:21 +00:00
|
|
|
with:
|
2022-03-01 05:43:52 +00:00
|
|
|
branch: ci/lockfile
|
2022-06-27 18:02:44 +00:00
|
|
|
# Access token is needed to trigger CI on this PR
|
|
|
|
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
|
2023-02-24 15:52:43 +00:00
|
|
|
commit-message: "[ci] update lockfile"
|
2023-05-16 13:35:06 +00:00
|
|
|
add-paths: pnpm-lock.yaml
|
2023-02-24 15:52:43 +00:00
|
|
|
title: "[ci] update lockfile"
|
2021-12-13 21:04:21 +00:00
|
|
|
body: >
|
2022-03-09 16:12:12 +00:00
|
|
|
This PR is auto-generated by a nightly GitHub action.
|
2021-12-13 21:04:21 +00:00
|
|
|
It should automatically be merged if tests pass.
|