Skip to content

Update LeetCode problem data #50

Update LeetCode problem data

Update LeetCode problem data #50

name: Update LeetCode problem data
on:
schedule:
# New problems are usually available each week after a LeetCode contest!
# Note that in UTC time the weekly contests are on Sundays.
# See also: https://crontab.guru/
- cron: 5 4 * * 0
# Allows running this workflow manually from the repository's Actions tab.
workflow_dispatch:
# Allow only one concurrent run. Queueing additional runs should cancel any
# in-progress run so that the latest run is the one that gets priority.
concurrency:
group: update-problem-data
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
update-problem-data:
# Only run this job on the original repository! To run this on your fork,
# update or remove the line below.
if: github.repository == 'code-chronicles-code/leetcode-curriculum'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up everything
uses: ./.github/workflows/set-up-everything
- name: Fetch LeetCode problem list
run: yarn workspace @code-chronicles/fetch-leetcode-problem-list start && mv -f workspaces/fetch-leetcode-problem-list/problems.jsonl workspaces/archive/
- name: Create or update PR
uses: peter-evans/create-pull-request@v6
with:
branch: leetcode-problem-list-auto-update
# TODO: maybe include the current date in the title and commit message
title: Update LeetCode problem data
commit-message: Update LeetCode problem data
# TODO: maybe include some statistics in the body
body: ""
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
delete-branch: true