-
Notifications
You must be signed in to change notification settings - Fork 186
52 lines (43 loc) · 1.52 KB
/
dedupe_deps.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
name: 'Deduplicate dependencies'
on:
workflow_dispatch:
inputs:
push_directly:
description: 'push directly to the branch'
type: boolean
default: false
run-name: Deduplicate dependencies on ${{ github.ref_name }}
jobs:
dedupe_deps:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node setup
uses: ./.github/actions/node-setup
- name: Dedupe deps
run: yarn dedupe
- name: Set Git credentials
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Create pull request with deduped deps
if: ${{ inputs.push_directly != true }}
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
title: 'chore: Deduplicate dependencies on ${{ github.ref_name }}'
branch: ${{ github.ref_name }}-dedupe-deps
commit-message: 'chore: deduplicate dependencies'
body: Automated dependencies deduplication
delete-branch: true
- name: Commit files
if: ${{ inputs.push_directly == true }}
run: |
git commit -a -m "chore: deduplicate dependencies"
- name: Push changes to the branch directly
if: ${{ inputs.push_directly == true }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
branch: ${{ github.ref_name }}