-
Notifications
You must be signed in to change notification settings - Fork 546
47 lines (44 loc) · 1.5 KB
/
auto_sort_files.yml
File metadata and controls
47 lines (44 loc) · 1.5 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
name: Auto sort files
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
permissions:
contents: read
jobs:
sort-file:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3
with:
app-id: ${{ secrets.CQ_APP_ID }}
private-key: ${{ secrets.CQ_APP_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "lts/*"
- name: Install tools
run: |
npm i -g yaml-sort@2.0.0
npm i -g json-sort-cli@3.0.9
- name: Sort files
run: |
jsonsort release-please-config.json
yaml-sort -i .github/pr_labeler.yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
with:
# required so the PR triggers workflow runs
token: ${{ steps.app-token.outputs.token }}
branch: chore/sort-files
base: main
title: "chore: Sort files"
commit-message: "chore: Sort files"
body: This PR was created by a scheduled workflow to sort files to avoid git conflicts.
labels: automerge