-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.57 KB
/
format.yml
File metadata and controls
59 lines (49 loc) · 1.57 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
59
name: Format using prettier
# Run workflow each time code is pushed to your repository and on a schedule.
# The scheduled workflow runs every Thursday at 15:45 UTC.
on:
push:
branches:
- master
- development
schedule:
- cron: "45 15 * * 4"
permissions:
contents: write
pull-requests: write
jobs:
lint:
name: Format using prettier
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [16]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v6.0.2
with:
persist-credentials: false
- name: Checkout code
uses: actions/checkout@v6.0.2
- name: Install Dependencies
run: npm ci
- name: Format using prettier
run: npx prettier . --write
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "[Automated] Format using prettier"
title: "[Automated] Format using prettier"
body: "This is an automated pull request to format the code using prettier."
branch: "format-using-prettier"
delete-branch: true
labels: automated, style
- name: Enable Automerge 🤖
if: steps.cpr.outputs.pull-request-number != ''
run: |
echo "Enabling automerge for PR ${{ steps.cpr.outputs.pull-request-number }}"
gh pr merge ${{ steps.cpr.outputs.pull-request-number }} --auto --squash --delete-branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}