Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Refresh pkg.go.dev & Go Report Card #60

Open
riandyrn opened this issue Jul 22, 2023 · 0 comments
Open

Auto Refresh pkg.go.dev & Go Report Card #60

riandyrn opened this issue Jul 22, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@riandyrn
Copy link
Collaborator

When we release new version, it should be automatically reflected in both pkg.go.dev & go report card.

I think we should create github action workflow that will be triggered whenever we release a new version. After that, the workflow will do the following:

  1. Refresh pkg.go.dev by using this HTTP request (remember to change the version to the version released):

    curl --location --request POST 'https://pkg.go.dev/fetch/github.com/Haraj-backend/[email protected]' \
    --header 'authority: pkg.go.dev' \
    --header 'accept: */*' \
    --header 'accept-language: en-US,en;q=0.9,id-ID;q=0.8,id;q=0.7,en-GB;q=0.6,ar-SA;q=0.5,ar;q=0.4' \
    --header 'cache-control: no-cache' \
    --header 'content-length: 0' \
    --header 'cookie: _gcl_au=1.1.287297053.1687413285; HaTS_BKT=false; _gid=GA1.2.1798712449.1689947144; _gat_UA-141356704-1=1; _ga_HL38R6X1Q3=GS1.1.1690027744.16.1.1690027751.0.0.0; _ga=GA1.2.67863812.1679574217' \
    --header 'origin: https://pkg.go.dev' \
    --header 'pragma: no-cache' \
    --header 'referer: https://pkg.go.dev/github.com/Haraj-backend/[email protected]' \
    --header 'sec-ch-ua: "Not/A)Brand";v="99", "Google Chrome";v="115", "Chromium";v="115"' \
    --header 'sec-ch-ua-mobile: ?0' \
    --header 'sec-ch-ua-platform: "macOS"' \
    --header 'sec-fetch-dest: empty' \
    --header 'sec-fetch-mode: cors' \
    --header 'sec-fetch-site: same-origin' \
    --header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
    
  2. Refresh go report card by using this HTTP request:

    curl --location 'https://goreportcard.com/checks' \
    --header 'Accept: application/json, text/javascript, */*; q=0.01' \
    --header 'Accept-Language: en-US,en;q=0.9,id-ID;q=0.8,id;q=0.7,en-GB;q=0.6,ar-SA;q=0.5,ar;q=0.4' \
    --header 'Cache-Control: no-cache' \
    --header 'Connection: keep-alive' \
    --header 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
    --header 'Cookie: _ga_TFTF5Y92QD=GS1.1.1689127277.2.0.1689127280.0.0.0; _ga=GA1.2.366801965.1689044317; _gid=GA1.2.594844943.1689947182; _gat=1' \
    --header 'Origin: https://goreportcard.com' \
    --header 'Pragma: no-cache' \
    --header 'Referer: https://goreportcard.com/report/github.com/Haraj-backend/hex-monscape' \
    --header 'Sec-Fetch-Dest: empty' \
    --header 'Sec-Fetch-Mode: cors' \
    --header 'Sec-Fetch-Site: same-origin' \
    --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36' \
    --header 'X-Requested-With: XMLHttpRequest' \
    --header 'sec-ch-ua: "Not/A)Brand";v="99", "Google Chrome";v="115", "Chromium";v="115"' \
    --header 'sec-ch-ua-mobile: ?0' \
    --header 'sec-ch-ua-platform: "macOS"' \
    --data 'repo=github.com%2FHaraj-backend%2Fhex-monscape'
    

When we release new version, it should be automatically reflected in both pkg.go.dev & go report card.

I think we should create github action workflow that will be triggered whenever we release a new version. After that, the workflow will do the following:

  1. Refresh pkg.go.dev by using this HTTP request (remember to change the version to the version released):

    curl --location --request POST 'https://pkg.go.dev/fetch/github.com/Haraj-backend/[email protected]' \
    --header 'authority: pkg.go.dev' \
    --header 'accept: */*' \
    --header 'accept-language: en-US,en;q=0.9,id-ID;q=0.8,id;q=0.7,en-GB;q=0.6,ar-SA;q=0.5,ar;q=0.4' \
    --header 'cache-control: no-cache' \
    --header 'content-length: 0' \
    --header 'cookie: _gcl_au=1.1.287297053.1687413285; HaTS_BKT=false; _gid=GA1.2.1798712449.1689947144; _gat_UA-141356704-1=1; _ga_HL38R6X1Q3=GS1.1.1690027744.16.1.1690027751.0.0.0; _ga=GA1.2.67863812.1679574217' \
    --header 'origin: https://pkg.go.dev' \
    --header 'pragma: no-cache' \
    --header 'referer: https://pkg.go.dev/github.com/Haraj-backend/[email protected]' \
    --header 'sec-ch-ua: "Not/A)Brand";v="99", "Google Chrome";v="115", "Chromium";v="115"' \
    --header 'sec-ch-ua-mobile: ?0' \
    --header 'sec-ch-ua-platform: "macOS"' \
    --header 'sec-fetch-dest: empty' \
    --header 'sec-fetch-mode: cors' \
    --header 'sec-fetch-site: same-origin' \
    --header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
    
  2. Refresh go report card by using this HTTP request:

    curl --location 'https://goreportcard.com/checks' \
    --header 'Accept: application/json, text/javascript, */*; q=0.01' \
    --header 'Accept-Language: en-US,en;q=0.9,id-ID;q=0.8,id;q=0.7,en-GB;q=0.6,ar-SA;q=0.5,ar;q=0.4' \
    --header 'Cache-Control: no-cache' \
    --header 'Connection: keep-alive' \
    --header 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
    --header 'Cookie: _ga_TFTF5Y92QD=GS1.1.1689127277.2.0.1689127280.0.0.0; _ga=GA1.2.366801965.1689044317; _gid=GA1.2.594844943.1689947182; _gat=1' \
    --header 'Origin: https://goreportcard.com' \
    --header 'Pragma: no-cache' \
    --header 'Referer: https://goreportcard.com/report/github.com/Haraj-backend/hex-monscape' \
    --header 'Sec-Fetch-Dest: empty' \
    --header 'Sec-Fetch-Mode: cors' \
    --header 'Sec-Fetch-Site: same-origin' \
    --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36' \
    --header 'X-Requested-With: XMLHttpRequest' \
    --header 'sec-ch-ua: "Not/A)Brand";v="99", "Google Chrome";v="115", "Chromium";v="115"' \
    --header 'sec-ch-ua-mobile: ?0' \
    --header 'sec-ch-ua-platform: "macOS"' \
    --data 'repo=github.com%2FHaraj-backend%2Fhex-monscape'
    

Note:

For go report card, if we have more than one change within 24 hours, the latest changes will be reflected after 24 hours. Just beware of this.

For go report card, if we have more than one changes within 24 hours, the latest changes will be reflected after 24 hours. Just beware of this.

@riandyrn riandyrn added enhancement New feature or request good first issue Good for newcomers labels Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant