diff --git a/.github/workflows/featured_issues.yml b/.github/workflows/featured_issues.yml new file mode 100644 index 00000000..f3fb6861 --- /dev/null +++ b/.github/workflows/featured_issues.yml @@ -0,0 +1,33 @@ +name: Fetch Featured Issues + +on: + issues: + types: [opened, labeled] + pull_request: + types: + - opened + - updated + +jobs: + fetch-issues: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Fetch Featured Issues + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Fetch all open issues labeled as "featured" + issues=$(gh issue list --limit 1000 --state open --label "featured" --json number,title,url) + + # Save the issues to a featured-issues.json + echo "$issues" | jq > packages/frontendmu-data/data/featured-issues.json + + # Commit the changes + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "GitHub Action[bot]" + git add packages/frontendmu-data/data/featured-issues.json + git commit -m "Update featured issues" + git push