-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.4 KB
/
kicad-dates.yaml
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
62
63
on:
push:
branches:
- main
paths:
- '**.kicad_sch'
- '**.kicad_pcb'
name: KiCad Date Update
jobs:
get-changed-files:
name: Get changed files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed PCB files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
**/*.kicad_pcb
**/*.kicad_sch
matrix: true
outputs:
any-changed: ${{ steps.changed-files.outputs.any_changed }}
matrix: ${{ steps.changed-files.outputs.all_changed_files }}
update:
if: ${{ fromJson(needs.get-changed-files.outputs.any-changed) }}
needs: get-changed-files
name: Update KiCad dates
runs-on: ubuntu-latest
strategy:
matrix:
file: ${{ fromJSON(needs.get-changed-files.outputs.matrix) }}
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Update KiCad file dates
run: |
TODAY=$(date +%F)
sed -i "s/(date \".*\"/(date \"$TODAY\"/" ${{ matrix.file }}
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actor
message: "chore: update KiCad dates"