Skip to content

Commit

Permalink
Merge pull request #10 from rseng/add/escape-title
Browse files Browse the repository at this point in the history
Fixing issue with escaping quotes
  • Loading branch information
vsoch authored Mar 11, 2020
2 parents de9f63a + ca81f34 commit d6636a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ than one collection, you can change this to something else.
- name: Checkout Code
uses: actions/checkout@v2
- name: Generate First Issues
uses: rseng/[email protected].2
uses: rseng/[email protected].3
with:
repos-file: '.github/repos.txt'
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -61,7 +61,7 @@ Here is how you might update the label used:
- name: Checkout Code
uses: actions/checkout@v2
- name: Generate First Issues
uses: rseng/[email protected].2
uses: rseng/[email protected].3
with:
label: 'bug'
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -76,7 +76,7 @@ as a relative path to the docs folder, I can set that as follows:
- name: Checkout Code
uses: actions/checkout@v2
- name: Generate First Issues
uses: rseng/[email protected].2
uses: rseng/[email protected].3
with:
collection: '_another'
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 7 additions & 3 deletions scripts/generate-first-issues.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

import json
import os
import requests
import sys
Expand Down Expand Up @@ -48,7 +49,7 @@
try:
repo, extra_tags = line.strip().split(" ")
except ValueError:
repo = line.strip()
repo = line.strip()

extra_tags = extra_tags.split(",")
repo = "/".join(repo.split("/")[-2:])
Expand Down Expand Up @@ -81,9 +82,12 @@
if tags:
tags = [x.replace(":", "").replace(" ", "-") for x in tags]
tags.sort()
print("Adding tags %s" % ",".join(tags))
content += "tags: %s\n" % (",".join(tags))
for param in ["title", "html_url"]:
content += '%s: "%s"\n' % (param, issue[param])

# Title must have quotes escaped
content += 'title: %s\n' % json.dumps(issue["title"])
content += 'html_url: "%s"\n' % issue["html_url"]
content += "user: %s\n" % (issue["user"]["login"])
content += "repo: %s\n" % repo
content += "---\n\n"
Expand Down

0 comments on commit d6636a4

Please sign in to comment.