Skip to content

Refactor approved.json to group versions by actionLink - #188

Open
stephenfuqua with Copilot wants to merge 2 commits into
mainfrom
copilot/refactor-approved-file-structure
Open

Refactor approved.json to group versions by actionLink#188
stephenfuqua with Copilot wants to merge 2 commits into
mainfrom
copilot/refactor-approved-file-structure

Conversation

Copilot AI commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

Restructured approved.json from a flat list with duplicate actionLinks to a grouped format where each action contains a versions array. This consolidates 78 entries into 42 unique actions while preserving all version and deprecation metadata.

Changes

  • approved.json: Transformed structure from {actionLink, actionVersion, tag?, deprecated?}[] to {actionLink, versions: [{version, tag?, deprecated?}][]}[]
  • actions_parser.py: Updated invoke_validate_actions() to iterate through nested version arrays instead of filtering flat lists
  • test_actions_parser.py: Updated test fixtures to match new structure

Before/After

// Before: duplicate actionLinks
[
  {"actionLink": "dawidd6/action-download-artifact", "actionVersion": "abc123", "tag": "v7", "deprecated": true},
  {"actionLink": "dawidd6/action-download-artifact", "actionVersion": "def456", "tag": "v9"}
]

// After: grouped by actionLink
[
  {
    "actionLink": "dawidd6/action-download-artifact",
    "versions": [
      {"version": "abc123", "tag": "v7", "deprecated": true},
      {"version": "def456", "tag": "v9"}
    ]
  }
]

All existing functionality preserved: auto-approval for github/* and actions/* namespaces, deprecation warnings, and version validation.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Engineering] Refactor the approved file</issue_title>
<issue_description># Task 1

Refactor the action-allowedlist/approved.json file to the following structure:

[
    {
        "actionLink": "<placeholder>",
        "versions": [
            {
                "version": "<placeholder>",
                "tag": "<placeholder>",
                "deprecated": <true | false>
            }
        ]
    }
]

Task 1 Example

Before

[
  {
    "actionLink": "dawidd6/action-download-artifact",
    "actionVersion": "80620a5d27ce0ae443b965134db88467fc607b43",
    "tag": "v7",
    "deprecated": true
  },
  {
    "actionLink": "dawidd6/action-download-artifact",
    "actionVersion": "07ab29fd4a977ae4d2b275087cf67563dfdf0295",
    "tag": "v9"
  }
]

After

[
  {
    "actionLink": "dawidd6/action-download-artifact",
    "versions": [
        {
            "version": "80620a5d27ce0ae443b965134db88467fc607b43",
            "tag": "v7",
            "deprecated": true
        },
        {
            "version": "07ab29fd4a977ae4d2b275087cf67563dfdf0295",
            "tag": "v9"
        }
    ]
  }
]

Task 2

Refactor Python script action_allowedlist/actions_parser.py to use the new JSON file structure described above.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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.

Co-authored-by: stephenfuqua <9324390+stephenfuqua@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor approved file to new JSON structure Refactor approved.json to group versions by actionLink Dec 19, 2025
Copilot AI requested a review from stephenfuqua December 19, 2025 20:31
@stephenfuqua

Copy link
Copy Markdown
Contributor

I ran this locally to confirm that it is working correctly. We can also run the workflow in a branch, except that GitHub doesn't allow running workflows from Copilot branches. To get around this, I created a branch called tmp from the copilot branch, pushed that, and ran the process. The result is green ✅ . Now I'll delete tmp.

This looks good to me. Let's see what others think.

@stephenfuqua
stephenfuqua marked this pull request as ready for review December 19, 2025 20:48
@stephenfuqua
stephenfuqua requested a review from a team as a code owner December 19, 2025 20:48
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.

[Engineering] Refactor the approved file

3 participants