Skip to content

🚀 Feature Request: Add in API redirect for GitUpdater #411

@Ipstenu

Description

@Ipstenu

Describe the problem that needs this feature

Sometimes Github is stupid and thinks we run out of API credits.

Describe the solution you'd like

Redirecting the download link value to Fastly, which we have greater controller over

Describe alternatives you've considered

Pushing a new release and API keys, neither helped.

Code Concept

add_filter( 'gu_post_api_response_body', function( $response, $url ) {
    // Only modify response for fair-plugin
    if ( strpos( $url, 'slug=fair-plugin' ) !== false ) {

       $download_url = 'https://download.fair.pm/fair-plugin-'. $data['version'] '.zip'

       // ToDO: IF the file does not exist, return $response;

        $data = json_decode( $response, true );
        
        if ( isset( $data['download_link'] ) ) {
            // Set your temporary download link here
            $data['download_link'] = $download_url;
            
            $response = json_encode( $data );
        }
    }
    
    return $response;
}, 10, 2 );

Changes to Deploy Process

We need to add in an Rsync (or whatever) to push the file to Fastly. This will require read/write keys being stored in Github Secrets (AND ALSO 1PASSWORD)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Status

    Icebox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions