-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (48 loc) · 1.39 KB
/
game-updates.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Update GAMEUPDATES
on:
push:
branches:
- GAMEUPDATES
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get the date message
id: msg
run: echo "::set-output name=msg::$(date +'%Y-%m-%d') game updates"
shell: bash
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Update GAMEDATES
run: |
wget https://raw.githubusercontent.com/darwintree/sc-viewer-v2/GAMEUPDATES/GAMEUPDATES.md -O GAMEUPDATES.md
- name: Commit changes
id: auto-commit-action
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: asset-update-branch
create_branch: true
commit_message: ${{ steps.msg.outputs.msg }}
- name: Create viewer PR
if: steps.auto-commit-action.outputs.changes_detected == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.PAT }}
script: |
await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'New game assets detected',
head: 'asset-update-branch',
base: 'main',
})