-
Notifications
You must be signed in to change notification settings - Fork 16
51 lines (43 loc) · 1.41 KB
/
remove-tool.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
name: Remove Tool
run-name: Remove ${{ inputs.toolName }} by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
toolName:
description: 'Folder name in gitbook/tools'
type: string
required: true
jobs:
remove-tool:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Run node script to generate new tool
id: node
env:
TOOL_NAME: ${{ inputs.toolName }}
run: |
node src/remove-tool.mjs $TOOL_NAME
- name: Commit changes
env:
TOOL_NAME: ${{ inputs.toolName }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Remove $TOOL_NAME"
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: remove-tool-${{ inputs.toolName }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: remove-tool-${{ inputs.toolName }}
commit-message: "Remove Tool: ${{ inputs.toolName }}"
title: "Remove Tool: ${{ inputs.toolName }}"
body: "This pull request removes ${{ inputs.toolName }} from gitbook/tools and from SUMMARY.md."