Skip to content

chore(deps-dev): bump @types/node from 22.10.7 to 22.10.10 #14

chore(deps-dev): bump @types/node from 22.10.7 to 22.10.10

chore(deps-dev): bump @types/node from 22.10.7 to 22.10.10 #14

Workflow file for this run

name: "🚀 Release on Comment"
on:
issue_comment:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
if: github.event.issue.pull_request
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "16"
- name: 💬 Parse comment for release version
id: parse_version
run: |
COMMENT_BODY="${{ github.event.comment.body }}"
if [[ $COMMENT_BODY =~ ^release\ ([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
echo "RELEASE_VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV
else
echo "Comment does not match 'release <semver>' format."
exit 1
fi
- name: 👍 Add thumbs-up reaction to comment
run: |
COMMENT_ID=${{ github.event.comment.id }}
curl -s -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-X POST "https://api.github.com/repos/${{ github.repository }}/issues/comments/$COMMENT_ID/reactions" \
-d '{"content":"+1"}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: ✍️ Update package.json version
run: |
jq '.version = env.RELEASE_VERSION' package.json > temp.json && mv temp.json package.json
shell: bash
- name: 🔖 Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add package.json
git commit -m "chore(release): Set version to $RELEASE_VERSION"
- name: 📤 Push commit
run: |
git push origin "HEAD:${{ github.event.pull_request.head.ref }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: ✍️ Update PR title
run: |
DATE=$(date +'%Y-%m-%d')
gh pr edit ${{ github.event.issue.number }} --title "chore(release): $DATE ($RELEASE_VERSION)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 📣 Post release confirmation comment
run: |
DATE=$(date +'%Y-%m-%d')
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
COMMENT_BODY="### 🚀 Release planned: $DATE ($RELEASE_VERSION)"
curl -s -H "Authorization: token $GITHUB_TOKEN" \
-X POST "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments" \
-d "{\"body\": \"$COMMENT_BODY\"}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}