Skip to content

🧻 Rulička bot

🧻 Rulička bot #601

Workflow file for this run

name: 🧻 Rulička bot
on:
workflow_dispatch:
inputs:
filename:
description: 'Filename (without extension)'
required: true
default: ''
content:
description: 'Content (JSON data)'
required: true
default: ''
title:
description: 'Place name'
required: true
default: ''
jobs:
create_json:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: 🔐 Generate a token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.RULICKA_ID }}
private_key: ${{ secrets.RULICKA_PRIVATE_KEY }}
- name: Create a json file
run: |
cd _toilets
echo '${{ github.event.inputs.content }}' > ${{ github.event.inputs.filename }}.json
cat ${{ github.event.inputs.filename }}.json
- name: Create a pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{steps.generate_token.outputs.token}}
commit-message: Add ${{ github.event.inputs.filename }}.json toilet
signoff: false
branch: new-toilet-${{ github.event.inputs.filename }}
delete-branch: true
title: '${{ fromJSON(github.event.inputs.content).nickName }} is requesting the addition of a new toilet ${{ github.event.inputs.title }}'
body: |
${{ fromJSON(github.event.inputs.content).nickName }} is requesting the addition of a new toilet ${{ github.event.inputs.title }} with this parameters:
| KEY | VALUE |
| ------ | ---------- |
| placeName | **${{ fromJSON(github.event.inputs.content).placeName }}** |
| coords | `${{ fromJSON(github.event.inputs.content).latitude }}` `${{ fromJSON(github.event.inputs.content).longtitude }}` |
| wayDescription | ${{ fromJSON(github.event.inputs.content).wayDescription }} |
| toiletType | ${{ fromJSON(github.event.inputs.content).toiletType }} |
| comment | ${{ fromJSON(github.event.inputs.content).comment }} |
| nickName | ${{ fromJSON(github.event.inputs.content).nickName }} |
| timeStamp | ${{ fromJSON(github.event.inputs.content).timeStamp }} |
Filename: ${{ github.event.inputs.filename }}.json
```json
${{ toJSON(fromJSON(github.event.inputs.content)) }}
```
labels: |
toilet
reviewers: petrkucerak
draft: false