File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ name: "Publish a flake to flakestry"
2
2
on :
3
3
push :
4
4
tags :
5
- - " v?[0-9]+.[0-9]+.[0-9]+"
6
- - " v?[0-9]+.[0-9]+"
5
+ # This pattern matches tags in the format YYYY.MM.DD
6
+ # It expects a four-digit year, followed by a two-digit month and day
7
+ - " [0-9]{4}.[0-9]{2}.[0-9]{2}"
7
8
workflow_dispatch :
8
9
inputs :
9
10
tag :
Original file line number Diff line number Diff line change
1
+ name : " Weekly Date Tag"
2
+
3
+ on :
4
+ schedule :
5
+ - cron : ' 0 0 * * 0'
6
+
7
+ jobs :
8
+ tag-repo :
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - name : Checkout repository
13
+ uses : actions/checkout@v4
14
+
15
+ - name : Create and push tag using current date
16
+ run : |
17
+ TAG_DATE=$(date -u "+%Y.%m.%d")
18
+ if git rev-parse "$TAG_DATE" >/dev/null 2>&1; then
19
+ echo "Tag $TAG_DATE already exists. Skipping tag creation."
20
+ else
21
+ git config user.name "github-actions"
22
+ git config user.email "[email protected] "
23
+ git tag $TAG_DATE
24
+ git push origin $TAG_DATE
25
+ fi
You can’t perform that action at this time.
0 commit comments