G4F Issue Auto Reply workflow (CharlesPikachu/freeproxy)
The G4F Issue Auto Reply workflow from CharlesPikachu/freeproxy, explained and optimized by Latchkey.
CI health: A - excellent
Point runs-on at Latchkey and get caching, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the G4F Issue Auto Reply workflow from the CharlesPikachu/freeproxy repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: G4F Issue Auto Reply
on:
issues:
types: [opened]
permissions:
issues: write
contents: read
jobs:
reply:
runs-on: ubuntu-latest
if: ${{ github.event.issue.user.type != 'Bot' }}
timeout-minutes: 10
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -U "g4f[all]" requests openai
- name: Create g4f Dirs
run: mkdir -p ~/.g4f/cookies
- name: Generate and Post Issue Reply
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
G4F_MODELS: ${{ vars.G4F_MODELS }}
ECYLT_FREE_GPT_ENABLED: ${{ vars.ECYLT_FREE_GPT_ENABLED || 'true' }}
ECYLT_FREE_GPT_URL: ${{ vars.ECYLT_FREE_GPT_URL || 'https://api.ecylt.top/v1/free_gpt/chat_json.php' }}
OPENAI_COMPATIBLE_API_KEY: ${{ secrets.OPENAI_COMPATIBLE_API_KEY }}
OPENAI_COMPATIBLE_BASE_URL: ${{ vars.OPENAI_COMPATIBLE_BASE_URL }}
OPENAI_COMPATIBLE_MODEL: ${{ vars.OPENAI_COMPATIBLE_MODEL }}
G4F_TIMEOUT_SECONDS: "90"
MAX_REPLY_CHARS: "65536"
run: |
python ./scripts/g4f_issue_reply.pyThe same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: G4F Issue Auto Reply on: issues: types: [opened] permissions: issues: write contents: read jobs: reply: runs-on: latchkey-small if: ${{ github.event.issue.user.type != 'Bot' }} timeout-minutes: 10 steps: - name: Checkout Repository uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: cache: 'pip' python-version: "3.11" - name: Install Dependencies run: | python -m pip install --upgrade pip pip install -U "g4f[all]" requests openai - name: Create g4f Dirs run: mkdir -p ~/.g4f/cookies - name: Generate and Post Issue Reply env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} G4F_MODELS: ${{ vars.G4F_MODELS }} ECYLT_FREE_GPT_ENABLED: ${{ vars.ECYLT_FREE_GPT_ENABLED || 'true' }} ECYLT_FREE_GPT_URL: ${{ vars.ECYLT_FREE_GPT_URL || 'https://api.ecylt.top/v1/free_gpt/chat_json.php' }} OPENAI_COMPATIBLE_API_KEY: ${{ secrets.OPENAI_COMPATIBLE_API_KEY }} OPENAI_COMPATIBLE_BASE_URL: ${{ vars.OPENAI_COMPATIBLE_BASE_URL }} OPENAI_COMPATIBLE_MODEL: ${{ vars.OPENAI_COMPATIBLE_MODEL }} G4F_TIMEOUT_SECONDS: "90" MAX_REPLY_CHARS: "65536" run: | python ./scripts/g4f_issue_reply.py
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cache dependency installs on the setup step so they are served from cache.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.