Skip to content
117 changes: 64 additions & 53 deletions .github/workflows/update-types.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,66 @@
name: Update Skins,Agents,Buddies,Chroma and Sprays
name: Update Valorant Resources

on:
schedule:
- cron: "0 18 * * 2"
workflow_dispatch:
schedule:
# every Tuesday at 18:00 UTC
- cron: '0 18 * * 2'
workflow_dispatch:

permissions:
contents: write

jobs:
update-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false

- name: Cache node modules
uses: actions/cache@v2
id: cache-node-modules
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: "**/node_modules"
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Install Axios
if: steps.cache-node-modules.outputs.cache-hit != 'true' # Over here!
run: yarn add axios

- name: Update Types
run: yarn update:types

- name: Pull-request with updates
uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: "Updated Skins, Agents, Chroma, Sprays and Buddies"
body: "Workflow made to automatically update skins, agents, buddies and sprays."
branch: "bot/update_valorant_resources"
path: "src/resources"
author: "ValClientAction <[email protected]>"
commit-message: "chore: updated resources (skins,agents,sprays,buddies)"
update-pull-request-title-and-body: false
- name: Add commit for types in pull-request
uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: "bot/update_valorant_resources"
path: "src/types"
author: "ValClientAction <[email protected]>"
commit-message: "chore: updated types (skins,agents,sprays,buddies)"
update:
runs-on: ubuntu-latest
concurrency:
group: valorant-resources-update
cancel-in-progress: true

steps:
# checkout with full history so rebasing the bot branch works
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

# set up Node 22 and cache dependencies via Yarn
- name: "Setup Node.js"
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'yarn' # caches Yarn cache dir, not node_modules
cache-dependency-path: '**/yarn.lock'

# install all deps (including axios) in one go
- name: "Install dependencies"
run: yarn install --frozen-lockfile

# run your type-generation/update script
- name: Update Types
run: yarn update:types

# commit any changes under src/resources
- name: "Create or update Pull Request: resources"
uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: "chore: update Valorant resources"
body: |
This automated PR updates Valorant skins, agents, chroma, sprays, and buddies.
branch: "bot/update_valorant_resources"
path: "src/resources"
author: "ValClientAction <[email protected]>"
commit-message: "chore: update resources (skins, agents, chroma, sprays, buddies)"
update-pull-request-title-and-body: false # don't overwrite the title/body on each update

# commit any changes under src/types onto the same branch
- name: Add types commit to PR
uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: "bot/update_valorant_resources"
path: "src/types"
author: "ValClientAction <[email protected]>"
commit-message: "chore: update types (skins, agents, chroma, sprays, buddies)"
2 changes: 1 addition & 1 deletion __tests__/group.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const mockedCurrentGroupDetails: GroupDetails = {

const mockedCurrentAvailableGameModes: CurrentAvailableGameModeResponse = {
Enabled: true,
EnabledMaps: ["Ascent", "Bind", "Breeze", "Fracture", "Heaven", "Icebox", "Split"],
EnabledMaps: ["Ascent", "Bind", "Breeze", "Fracture", "Haven", "Icebox", "Split"],
EnabledModes: ["test"],
GamePodPingServiceInfo: {
ping: {
Expand Down
8 changes: 4 additions & 4 deletions __tests__/loadout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const mockedYourItemsBuddy: YourItems<"buddy"> = {
InstanceID: "test",
},
{
ItemID: buddyLevelIdMappedByName["2021 VCT Masters Winner Buddy"]["1"],
ItemID: buddyLevelIdMappedByName["VCT LOCK//IN Winner Buddy"]["1"],
TypeID: "test",
InstanceID: "id_instance",
},
Expand Down Expand Up @@ -442,8 +442,8 @@ test("change a skin buddy", async () => {
{
...mockedCurrentLoadout.Guns[1],
ID: gunsIdMappedByName["Guardian"],
CharmID: buddyIdMappedByName["2021 VCT Masters Winner Buddy"],
CharmLevelID: buddyLevelIdMappedByName["2021 VCT Masters Winner Buddy"]["1"],
CharmID: buddyIdMappedByName["VCT LOCK//IN Winner Buddy"],
CharmLevelID: buddyLevelIdMappedByName["VCT LOCK//IN Winner Buddy"]["1"],
CharmInstanceID: "id_instance",
},
],
Expand All @@ -464,7 +464,7 @@ test("change a skin buddy", async () => {
httpService.fetch.mockResolvedValueOnce(mockedCurrentLoadoutWithGuardian);
httpService.put.mockResolvedValueOnce(mockedGunChangedLoadout);

const data = await loadout.addSkinBuddy("Guardian", "2021 VCT Masters Winner Buddy");
const data = await loadout.addSkinBuddy("Guardian", "VCT LOCK//IN Winner Buddy");

expect(data).toEqual(mockedGunChangedLoadout);
});
Expand Down
49 changes: 29 additions & 20 deletions src/resources/agents.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
/* eslint-disable prettier/prettier */
/* FILE GENERATED AUTOMATICALLY */

import { Agents } from "@type/agents";

export const agentsMappedById: Record<Agents, string> = {
Fade: "dade69b4-4f5a-8528-247b-219e5a1facd6",
Breach: "5f8d3a7f-467b-97f3-062c-13acf203c006",
Raze: "f94c3b30-42be-e959-889c-5aa313dba261",
Chamber: "22697a3d-45bf-8dd7-4fec-84a9e28c69d7",
"KAY/O": "601dbbe7-43ce-be57-2a40-4abd24953621",
Skye: "6f2a04ca-43e0-be17-7f36-b3908627744d",
Cypher: "117ed9e3-49f3-6512-3ccf-0cada7e3823b",
Sova: "320b2a48-4d9b-a075-30f1-1f93a9b638fa",
Killjoy: "1e58de9c-4950-5125-93e9-a0aee9f98746",
Viper: "707eab51-4836-f488-046a-cda6bf494859",
Phoenix: "eb93336a-449b-9c1b-0a54-a891f7921d69",
Astra: "41fb69c1-4189-7b37-f117-bcaf1e96f1bf",
Brimstone: "9f0d8ba9-4140-b941-57d3-a7ad57c6b417",
Neon: "bb2a4828-46eb-8cd1-e765-15848195d751",
Yoru: "7f94d92c-4234-0a36-9646-3a87eb8b5c89",
Sage: "569fdd95-4d10-43ab-ca70-79becc718b46",
Reyna: "a3bfb853-43b2-7238-a4f1-ad90e9e46bcc",
Omen: "8e253930-4c05-31dd-1b6c-968525494517",
Jett: "add6443a-41bd-e414-f6ad-e58d267f4e95",
};
"Gekko": "e370fa57-4757-3604-3648-499e1f642d3f",
"Fade": "dade69b4-4f5a-8528-247b-219e5a1facd6",
"Breach": "5f8d3a7f-467b-97f3-062c-13acf203c006",
"Deadlock": "cc8b64c8-4b25-4ff9-6e7f-37b4da43d235",
"Tejo": "b444168c-4e35-8076-db47-ef9bf368f384",
"Raze": "f94c3b30-42be-e959-889c-5aa313dba261",
"Chamber": "22697a3d-45bf-8dd7-4fec-84a9e28c69d7",
"KAY/O": "601dbbe7-43ce-be57-2a40-4abd24953621",
"Skye": "6f2a04ca-43e0-be17-7f36-b3908627744d",
"Cypher": "117ed9e3-49f3-6512-3ccf-0cada7e3823b",
"Sova": "320b2a48-4d9b-a075-30f1-1f93a9b638fa",
"Killjoy": "1e58de9c-4950-5125-93e9-a0aee9f98746",
"Harbor": "95b78ed7-4637-86d9-7e41-71ba8c293152",
"Vyse": "efba5359-4016-a1e5-7626-b1ae76895940",
"Viper": "707eab51-4836-f488-046a-cda6bf494859",
"Phoenix": "eb93336a-449b-9c1b-0a54-a891f7921d69",
"Astra": "41fb69c1-4189-7b37-f117-bcaf1e96f1bf",
"Brimstone": "9f0d8ba9-4140-b941-57d3-a7ad57c6b417",
"Iso": "0e38b510-41a8-5780-5e8f-568b2a4f2d6c",
"Clove": "1dbf2edd-4729-0984-3115-daa5eed44993",
"Neon": "bb2a4828-46eb-8cd1-e765-15848195d751",
"Yoru": "7f94d92c-4234-0a36-9646-3a87eb8b5c89",
"Waylay": "df1cb487-4902-002e-5c17-d28e83e78588",
"Sage": "569fdd95-4d10-43ab-ca70-79becc718b46",
"Reyna": "a3bfb853-43b2-7238-a4f1-ad90e9e46bcc",
"Omen": "8e253930-4c05-31dd-1b6c-968525494517",
"Jett": "add6443a-41bd-e414-f6ad-e58d267f4e95"
}
Loading