mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-10 00:44:21 +02:00
33b19848ef
This * Works with the GitHub permissions model (at least in local testing on another temporary repo) * Only comments when the timings actually change
36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
# Based on https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
|
|
name: Generate Course Schedule
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "src/**.md"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust cache
|
|
uses: ./.github/workflows/setup-rust-cache
|
|
|
|
- name: Generate Schedule
|
|
run: |
|
|
mkdir -p ./course-schedule
|
|
cargo run -p mdbook-course --bin course-schedule > course-schedule/schedule
|
|
|
|
# GitHub does not provide a reliable way to determine the PR number from which
|
|
# a workflow_run was triggered (https://github.com/orgs/community/discussions/25220),
|
|
# so we'll do the slightly awkward thing and put that in the artifact. This means
|
|
# schedules could potentially be spammed to any PR in the repository, but that is
|
|
# not an awful outcome (and clear, reportable evidence of abuse).
|
|
echo ${{ github.event.number }} > ./course-schedule/pr-number
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: course-schedule
|
|
path: course-schedule/
|