Skip to content

Add workflow to auto-sync updates.json.commit on main pushes#73

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-github-workflow-updates-json
Draft

Add workflow to auto-sync updates.json.commit on main pushes#73
Copilot wants to merge 3 commits intomainfrom
copilot/add-github-workflow-updates-json

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

This PR adds automation to keep updates.json’s commit field aligned with the latest commit on main. On every push to main, the workflow updates the field and writes back only when a change is required.

  • Workflow trigger + permissions

    • Added .github/workflows/update-updates-json.yml
    • Runs on push to main
    • Uses contents: write to commit back repository changes
  • updates.json commit sync

    • Reads updates.json, sets commit to the triggering SHA, and rewrites JSON with stable formatting
    • Avoids unnecessary commits by exiting when updates.json is unchanged
  • Loop prevention + commit behavior

    • Skips the job when actor is github-actions[bot] to prevent recursive workflow-triggered commits
    • Commits with bot identity and pushes the single-file update
jobs:
  update-commit:
    if: github.actor != 'github-actions[bot]'
    steps:
      - uses: actions/checkout@v4
      - run: |
          python3 - <<'PY'
          import json, os
          with open("updates.json", "r", encoding="utf-8") as f:
              data = json.load(f)
          data["commit"] = os.environ["LATEST_COMMIT"]
          with open("updates.json", "w", encoding="utf-8") as f:
              json.dump(data, f, indent=2); f.write("\n")
          PY

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits March 6, 2026 14:18
Co-authored-by: Itz-fork <77770753+Itz-fork@users.noreply.github.com>
Co-authored-by: Itz-fork <77770753+Itz-fork@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub workflow to update updates.json on push Add workflow to auto-sync updates.json.commit on main pushes Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants