Skip to content

Update Output

Update Output #9

Workflow file for this run

name: Update Output
on:
workflow_dispatch:
schedule:
- cron: "5 4 5,19 * *"
permissions:
contents: write
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Use Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
working-directory: ./getversions
- name: Run tool
run: bun run main.ts
working-directory: ./getversions
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add files
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add getversions/output.json
- name: Set env if git clean
run: echo "GITHUB_IS_GIT_CLEAN=$(git status -s | wc -l)" >> $GITHUB_ENV
- name: Commit & Push changes if necessary
if: ${{ env.GITHUB_IS_GIT_CLEAN != '0' }}
run: |
git commit -m "Update output"
git remote set-url origin https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push origin main