-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.62 KB
/
template-check-version.yml
File metadata and controls
50 lines (42 loc) · 1.62 KB
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
# Adapted from https://github.com/arup-group/actions-city-modelling-lab/blob/main/.github/workflows/template-check.yml
# MIT licensed
name: Reusable workflow for keeping up-to-date with template changes.
on:
workflow_call:
defaults:
run:
shell: bash -l {0}
jobs:
copier-issue:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
env:
UPDATE: "false"
steps:
- uses: actions/checkout@v4
with:
ref: "latest" # This avoids comparing against development versions.
- uses: mamba-org/setup-micromamba@v2
with:
environment-name: ${{ github.event.repository.name }}-copier
create-args: copier python=3.12
post-cleanup: all
cache-environment: true
- name: Add dummy GitHub credentials
run: |
git config --global user.name Copier update
git config --global user.email check@dummy.bot.com
- name: Run copier update
run: copier update --skip-answered --defaults
- name: Check for template changes
run: test -z "$(git status --porcelain)" || echo "UPDATE=true" >> $GITHUB_ENV
- name: Open issue
if: env.UPDATE == 'true'
run: |
gh issue --repo ${{ github.repository }} \
create --title "Template update" \
--body "The template has been updated.\n\nPlease run \`copier update\` in your local copy, review the changes, and merge them into the repository.\n\nIf you need help, refer to the \`clio\` documentation or reach out to the calliope project team."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}