Skip to content

Commit 5058761

Browse files
fix skip citations on pr close, remove useless on schedule preview build
1 parent 3a6446a commit 5058761

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/on-schedule.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,3 @@ jobs:
2020
uses: ./.github/workflows/update-citations.yaml
2121
with:
2222
open-pr: true
23-
24-
build-preview:
25-
needs: update-citations
26-
if: needs.update-citations.outputs.changed == 'true'
27-
uses: ./.github/workflows/build-preview.yaml

.github/workflows/update-citations.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,28 @@ jobs:
2626
update-citations:
2727
runs-on: ubuntu-latest
2828
timeout-minutes: 15
29-
if: github.event.action != 'closed'
3029

3130
steps:
3231
- name: Debug dump
3332
uses: crazy-max/ghaction-dump-context@v2
3433

3534
- name: Checkout branch contents
35+
if: github.event.action != 'closed'
3636
uses: actions/checkout@v4
3737
with:
3838
repository: ${{ github.event.pull_request.head.repo.full_name }}
3939
ref: ${{ github.head_ref }}
4040

4141
- name: Setup Python
42+
if: github.event.action != 'closed'
4243
uses: actions/setup-python@v5
4344
with:
4445
python-version: "3.11"
4546
cache: "pip"
4647
cache-dependency-path: "**/requirements.txt"
4748

4849
- name: Install Python packages
50+
if: github.event.action != 'closed'
4951
run: |
5052
python -m pip install --upgrade --requirement ./_cite/requirements.txt
5153
@@ -54,10 +56,12 @@ jobs:
5456
uses: mxschmitt/action-tmate@v3
5557

5658
- name: Build updated citations
59+
if: github.event.action != 'closed'
5760
run: python _cite/cite.py
5861
timeout-minutes: 15
5962

6063
- name: Check if citations changed
64+
if: github.event.action != 'closed'
6165
id: changed
6266
uses: tj-actions/verify-changed-files@v18
6367
with:
@@ -66,6 +70,7 @@ jobs:
6670
6771
- name: Commit updated citations to branch
6872
if: |
73+
github.event.action != 'closed' &&
6974
steps.changed.outputs.files_changed == 'true' &&
7075
inputs.open-pr != true
7176
uses: stefanzweifel/git-auto-commit-action@v5
@@ -74,6 +79,7 @@ jobs:
7479

7580
- name: Open pull request with updated citations
7681
if: |
82+
github.event.action != 'closed' &&
7783
steps.changed.outputs.files_changed == 'true' &&
7884
inputs.open-pr == true
7985
uses: peter-evans/create-pull-request@v6
@@ -84,4 +90,4 @@ jobs:
8490
To see a live preview of this PR, close (not merge) and reopen it.
8591
8692
outputs:
87-
changed: ${{ steps.changed.outputs.files_changed }}
93+
changed: ${{ steps.changed.outputs.files_changed || false }}

0 commit comments

Comments
 (0)