Skip to content

Commit

Permalink
fix(ci): add jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Nov 5, 2024
1 parent 4ea4ca6 commit d1a35af
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ on:
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
})
jobs:
tag:
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 d1a35af

Please sign in to comment.