-
Notifications
You must be signed in to change notification settings - Fork 8
56 lines (50 loc) · 1.88 KB
/
upstream_checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Upstream checks
on:
pull_request:
schedule:
- cron: "0 6 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
# Concurrency group that uses the workflow name and PR number if available
# or commit SHA as a fallback. If a new build is triggered under that
# concurrency group while a previous build is running it will be canceled.
# Repeated pushes to a PR will cancel all previous builds, while multiple
# merges to main will not cancel.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
check_pyproject_toml_changes:
permissions:
contents: read
issues: write
name: Report pyproject.toml changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: napari/napari
fetch-depth: 0
- name: Did pyproject.toml change since yesterday
run: |
changes="$(git diff $(git log -1 --before=@{last.day} --format=%H) pyproject.toml)"
echo "$changes"
if [[ -n "$changes" ]]; then
echo 'PYPROJECT_TOML_CHANGES<<EOF${{ github.run_id }}' >> $GITHUB_ENV
echo "$changes" >> $GITHUB_ENV
echo 'EOF${{ github.run_id }}' >> $GITHUB_ENV
echo "PYPROJECT_TOML_TODAY=$(date -I)" >> $GITHUB_ENV
fi
- name: Checkout packaging code
if: env.PYPROJECT_TOML_CHANGES && github.event_name == 'schedule'
uses: actions/checkout@v4
with:
repository: napari/packaging
- name: Create issue
if: env.PYPROJECT_TOML_CHANGES && github.event_name == 'schedule'
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/PYPROJECT_TOML_UPDATED_TEMPLATE.md
update_existing: true