mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-17 12:00:59 +02:00
Revised issue converter
This commit is contained in:
18
.github/workflows/convert-machine-file.yaml
vendored
18
.github/workflows/convert-machine-file.yaml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: comment
|
name: Convert to FluidNC from Issue
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
types:
|
types:
|
||||||
@@ -10,6 +10,10 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
issues: write
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
repository: bdring/Grbl_Esp32
|
||||||
|
ref: refs/heads/DumpConfig
|
||||||
|
|
||||||
- name: get attachment
|
- name: get attachment
|
||||||
id: download
|
id: download
|
||||||
@@ -46,14 +50,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mv $file_path Grbl_Esp32/src/Machines/convert-job.h
|
mv $file_path Grbl_Esp32/src/Machines/convert-job.h
|
||||||
python convert-machine.py convert-job.h
|
python convert-machine.py convert-job.h
|
||||||
printf "file_content<<EOF\n$(cat yaml/convert-job.yaml)\nEOF" >> $GITHUB_ENV
|
echo 'file_content<<EOF' >> $GITHUB_ENV
|
||||||
|
cat cat yaml/convert-job.yaml >> $GITHUB_ENV
|
||||||
- uses: octokit/request-action@v2.x
|
echo 'EOF' >> $GITHUB_ENV
|
||||||
id: get_artifact_url
|
|
||||||
with:
|
|
||||||
route: GET /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Add comment
|
- name: Add comment
|
||||||
uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
|
uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
|
||||||
@@ -66,4 +65,3 @@ jobs:
|
|||||||
```yaml
|
```yaml
|
||||||
${{ env.file_content }}
|
${{ env.file_content }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
66
.github/workflows/convert_from_issue.yml
vendored
66
.github/workflows/convert_from_issue.yml
vendored
@@ -1,66 +0,0 @@
|
|||||||
name: Convert to FluidNC from Issue
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
jobs:
|
|
||||||
add-comment:
|
|
||||||
if: contains(github.event.issue.title, 'translate machine file')
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@master
|
|
||||||
with:
|
|
||||||
repository: bdring/Grbl_Esp32
|
|
||||||
ref: refs/heads/DumpConfig
|
|
||||||
|
|
||||||
- name: get attachment
|
|
||||||
id: download
|
|
||||||
run: |
|
|
||||||
url=($(echo $body | awk -v RS=\( -v FS=\) 'NR>1{print $1}' ))
|
|
||||||
curl -OL $url
|
|
||||||
echo "file_path=${url##*/}" >> $GITHUB_ENV
|
|
||||||
env:
|
|
||||||
body: ${{github.event.issue.body}}
|
|
||||||
|
|
||||||
- name: Cache pip
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ~/.cache/pip
|
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pip-
|
|
||||||
- name: Cache PlatformIO
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ~/.platformio
|
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
|
|
||||||
- name: Install PlatformIO
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install --upgrade platformio
|
|
||||||
|
|
||||||
- name: Convert File
|
|
||||||
run: |
|
|
||||||
mv $file_path Grbl_Esp32/src/Machines/convert-job.h
|
|
||||||
python convert-machine.py convert-job.h
|
|
||||||
echo 'file_content<<EOF' >> $GITHUB_ENV
|
|
||||||
cat cat yaml/convert-job.yaml >> $GITHUB_ENV
|
|
||||||
echo 'EOF' >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Add comment
|
|
||||||
uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
|
|
||||||
with:
|
|
||||||
issue-number: ${{ github.event.issue.number }}
|
|
||||||
body: |
|
|
||||||
Dear ${{ github.event.issue.user.login }},
|
|
||||||
we converted your machine header-file ${{ env.file_path }} into a corresponding fluidNc yaml-file.
|
|
||||||
Please copy the following content into your `config.yaml` file and upload the file to your esp32.
|
|
||||||
```yaml
|
|
||||||
${{ env.file_content }}
|
|
||||||
```
|
|
Reference in New Issue
Block a user