-
Notifications
You must be signed in to change notification settings - Fork 95
38 lines (33 loc) · 1.18 KB
/
create-release-issue.yml
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
on:
schedule:
# * is a special character in YAML so you have to quote this string
# There's no direct way to schedule the job run every 2 weeks, instead we schedule it on the 1st and 15th of every month. The trick is taken from https://stackoverflow.com/a/46233330/7820085
- cron: "30 1 1,15 * *"
workflow_dispatch:
name: Create an issue to release the NPM package
permissions:
contents: read
issues: write
jobs:
create_issue:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Check if there's been any commits in the last two weeks
run: |
counter=$(git log --since='2 weeks ago' --pretty=oneline | wc -l)
if [ $counter -eq 0 ]; then
echo "No commits in the last two weeks, exiting"
exit 1
fi
echo "There are $counter commits in the last two weeks, continuing"
- name: Create an issue
uses: JasonEtco/create-an-issue@v2
if: success()
with:
filename: .github/release_new_npm_package_template.md
update_existing: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}