-
Notifications
You must be signed in to change notification settings - Fork 65
58 lines (51 loc) · 1.64 KB
/
Copy pathbuild_and_commit.yml
File metadata and controls
58 lines (51 loc) · 1.64 KB
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
58
name: Build and Commit
on:
workflow_dispatch:
inputs:
addAnnouncement:
description: 'Adds an announcement to announcements.json'
required: true
title:
description: 'Title'
required: false
body:
description: 'Body'
required: false
type:
description: 'Type (success, error, warning, info)'
required: false
newUser:
description: 'Show to all new users (true/false)'
required: false
default: 'false'
jobs:
build-and-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build project
run: yarn build
- name: Add announcement
if: ${{ github.event.inputs.addAnnouncement == 'true' }}
run: |
node .github/scripts/addAnnouncement.js \
"${{ github.event.inputs.title }}" \
"${{ github.event.inputs.body }}" \
"${{ github.event.inputs.type }}" \
"${{ github.event.inputs.newUser }}"
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "chore: build push"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} master