Skip to content

Update code.json

Update code.json #4

# -----------------------------------------------------------------------------
# GitHub Actions Workflow: generate-codejson.yml
#
# This workflow automates the process of updating the `code.json` file in the
# repository. It can be triggered manually or runs automatically on the first
# day of each month. The workflow:
# 1. Checks out the repository.
# 2. Uses the DSACMS/automated-codejson-generator action to update `code.json`
# and create a pull request with the changes.
# 3. Waits briefly to ensure the pull request is registered.
# 4. Automatically merges the pull request if it is found, then deletes the
# branch.
#
# Required permissions: contents, pull-requests, issues (write access).
# -----------------------------------------------------------------------------
name: Update code.json
on:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *" # monthly on day 1
permissions:
contents: write
pull-requests: write
issues: write
jobs:
update-code-json:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update code.json
uses: DSACMS/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: "main"