-
Notifications
You must be signed in to change notification settings - Fork 7
61 lines (52 loc) · 2.48 KB
/
update_graphblas.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
57
58
59
60
61
# Checks for latest SuiteSparse:GraphBLAS version on GitHub and creates a PR to update the version used by this repo.
name: Check for GraphBLAS updates
# In addition to permissions below, must explicitly allow GitHub Actions to create pull requests.
# This setting can be found in a repository's settings under Actions > General > Workflow permissions.
# https://github.com/peter-evans/create-pull-request#workflow-permissions
permissions:
contents: write
pull-requests: write
on:
# Note: Workflow must run at least once to appear in workflows list.
# Push to the bot's branch to trigger workflow.
push:
branches: [ auto_update_gb_version ]
# Note: Workflow must exist in main branch for workflow dispatch option to appear
workflow_dispatch:
# Enable cron to check for updates once a day:
# schedule:
# - cron: '0 0 * * *'
jobs:
gb_version_check:
name: Check for GraphBLAS update
if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' || github.repository == 'alugowski/python-suitesparse-graphblas'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Get latest GraphBLAS version
run: |
python latest_suitesparse_graphblas_version.py > GB_VERSION.txt
echo "GB_VERSION=$(cat GB_VERSION.txt)" >> $GITHUB_ENV
shell: bash
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
# See documentation: https://github.com/peter-evans/create-pull-request
# Action behavior: https://github.com/peter-evans/create-pull-request#action-behaviour
# TL;DR: create a PR if there is a diff and keep it up to date with changes as they arrive.
#
# To trigger tests with this PR set up a Personal Access Token as in the docs above.
# token: ${{ secrets.PAT }}
add-paths: GB_VERSION.txt
commit-message: Update to GraphBLAS ${{ env.GB_VERSION }}
title: Update to SuiteSparse:GraphBLAS ${{ env.GB_VERSION }}
body: |
Auto-generated by `update_graphblas.yml`
Close then reopen this PR to trigger tests. See [here](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs) for why automatic triggers do not work.
branch: auto_update_gb_version
delete-branch: true