Remove european-e-justice-portal by @johannawild #94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
npm run build | |
- 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 }} | |
force: true | |
- 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.\n\nCreated via workflow. In case of merge conflicts, re-run all jobs on [Run ${{ github.run_number }}](https://github.com/bellingcat/toolkit/actions/runs/${{ github.run_id }})." |