Skip to content

Commit

Permalink
feat: add weekly tags
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Nov 5, 2024
1 parent 912fffa commit e64db67
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Weekly tag

on:
schedule:
- cron: "0 10 * * 0"
workflow_dispatch:

permissions:
contents: write

steps:
- name: 🏷️ Create/update tag
uses: actions/github-script@v7
with:
script: |
const now = Date.now();
const onejan = new Date(now.getFullYear(), 0, 1);
/* This is not a ISO-8601 week number but works well for versioning */
const week = Math.ceil((((now.getTime() - onejan.getTime()) / 86400000) + onejan.getDay() + 1) / 7);
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/v${ now.fullYear() }.${ week }`,
sha: context.sha
})

0 comments on commit e64db67

Please sign in to comment.