Skip to content

fix: GitHubActions

fix: GitHubActions #24

Workflow file for this run

name: Generate currentIssues.json
on:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0,8,16 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
generate-issue-json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v1
- name: Extract branch name
id: extract_branch
run: |
echo "branch=${{ github.head_ref }}" >> $GITHUB_ENV
- name: Checkout to branch
run: |
git checkout ${{ env.branch }}
git config --global url."https://${{ secrets.BLOG_TOKEN }}:[email protected]/".insteadOf "ssh://[email protected]/"
- name: Check diff
id: diff
run: |
git add -N .
git diff --name-only --exit-code public/lastUpdated.ts public/currentIssues.json
continue-on-error: true
- name: Commit & Push
run: |
set -x
gh issue list --state all --json number,title,state,url,body > public/currentIssues.json && echo 'export const lastUpdated = \"'`date '+%Y-%m-%dT%H:%M:%S'`'\";' > public/lastUpdated.ts
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git add .
git commit -m 'chore: update currentIssues.json lastUpdated.ts' --allow-empty
git push origin ${{ env.branch }}
env:
GH_TOKEN: ${{ secrets.BLOG_TOKEN }}