Skip to content

profile!: bump version to v21.141 #160

profile!: bump version to v21.141

profile!: bump version to v21.141 #160

Workflow file for this run

name: Run fitgen Triggered by Comment
on:
issue_comment:
types:
- created
permissions: {}
jobs:
run-fitgen:
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
permissions:
contents: write # allow push commit
steps:
- name: Check PR comment
id: check-comment
env:
COMMENT: ${{ github.event.comment.body }} # Sanitize input using env to prevent script injection attack
run: |
if [[ "$COMMENT" =~ ^run\ fitgen\ ([0-9]+\.[0-9]+)$ ]]; then
echo "trigger=true" >> $GITHUB_OUTPUT
echo "profile_version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
else
echo "trigger=false" >> $GITHUB_OUTPUT
echo "Aborted: not a valid 'run fitgen <profile.version>' command"
exit 0
fi
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
if: steps.check-comment.outputs.trigger == 'true'
with:
token: "${{ secrets.FIT }}"
- name: Checkout PR
if: steps.check-comment.outputs.trigger == 'true'
env:
GITHUB_TOKEN: ${{ secrets.FIT }}
run: |
gh pr checkout ${{ github.event.issue.number }}
- name: Set up Go
if: steps.check-comment.outputs.trigger == 'true'
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: ">=1.18"
- name: Run fitgen
if: steps.check-comment.outputs.trigger == 'true'
run: |
export wd=$(pwd)
echo $wd
cd internal/cmd/fitgen
go run main.go -f Profile.xlsx -p ../../../ -b all --profile-version ${{ steps.check-comment.outputs.profile_version }} --verbose -y
cd $wd
sed -E -i 's/profile\-v[0-9]+\.[0-9]+-lightblue.svg/\profile-v${{ steps.check-comment.outputs.profile_version }}-lightblue.svg/' README.md
cd cmd/fitconv
go generate
cd $wd
cd cmd/fitprint
go generate
cd $wd
- name: Commit and Push
if: steps.check-comment.outputs.trigger == 'true'
env:
GITHUB_TOKEN: ${{ secrets.FIT }}
run: |
git config --global user.email "muktihaz@gmail.com"
git config --global user.name "Hikmatulloh Hari Mukti"
git add .
git commit -m "gh actions: generate files for v${{ steps.check-comment.outputs.profile_version }}"
git push