Skip to content

[Badge Giver] Update v1.2.5.16 #20

[Badge Giver] Update v1.2.5.16

[Badge Giver] Update v1.2.5.16 #20

Workflow file for this run

name: Auto Release on File Changes
on:
push:
paths:
- 'index.js'
- 'package.json'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Get version from package.json
id: get_version
run: |
echo "Getting version..."
version=$(node -p "require('./package.json').version")
echo "VERSION=$version" >> $GITHUB_ENV
# Print the value of VERSION for debugging
- name: Print VERSION
run: echo "VERSION=${{ env.VERSION }}"
- name: Zip changed files
run: |
zip -r BadgeGiver-v${{ env.VERSION }}.zip index.js package.json package-lock.json
- name: Get commit message
id: get_commit_message
run: |
COMMIT_MSG=$(git log --format=%b -n 1 ${{ github.sha }} | sed ':a;N;$!ba;s/\n/\ /g')
echo "COMMIT_MSG=\"$COMMIT_MSG\"" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v0.1.15
with:
files: |
BadgeGiver-v${{ env.VERSION }}.zip
tag_name: v${{ env.VERSION }}
name: "Update v${{ env.VERSION }}"
body: ${{ env.COMMIT_MSG }}
token: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
discussions: write