User-Agent Update #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: User-Agent Update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup golang | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
- name: Fetch JSONParser | |
run: | | |
go get github.com/buger/jsonparser | |
working-directory: _uaupdate | |
- name: Sort UA Data | |
run: | | |
go run . | |
working-directory: _uaupdate | |
- name: Reset gomod | |
run: | | |
go mod tidy | |
- name: Create local changes | |
run: | | |
git add protocol/http-user-agent.txt | |
- name: Commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit --allow-empty -m "HTTP User Agent update" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
branch: ua-update | |
title: HTTP User-Agent update |