Create an issue to release the NPM package #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |