Rework zeroconf for unicast scanning #15174
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: Log2HTML | |
on: | |
issues: | |
types: [opened, edited] | |
issue_comment: | |
jobs: | |
generate_html: | |
name: Generate HTML log | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install python packages | |
run: | | |
pip install --upgrade pip | |
python setup.py develop | |
pip install pygithub | |
- uses: jannekem/run-python-script-action@v1 | |
with: | |
fail-on-error: false | |
script: | | |
from github import Github | |
g = Github("${{ secrets.GITHUB_TOKEN }}") | |
repo = g.get_repo("${{ github.repository }}") | |
issue = repo.get_issue(${{ github.event.issue.number }}) | |
if "${{ github.event_name }}" == "issues": | |
body = issue.body | |
else: | |
body = issue.get_comment(${{ github.event.comment.id }}).body | |
with open("body", "w") as fh: | |
fh.write(body) | |
- name: Generate HTML output | |
id: genout | |
run: | | |
base_name=$(uuidgen) | |
echo "logfile=${base_name}.html" >> $GITHUB_ENV | |
if [ "${{ github.event_name }}" = "issues" ]; then | |
echo "source=issue description" >> $GITHUB_ENV | |
else | |
echo "source=for comment #${{ github.event.comment.id }}" >> $GITHUB_ENV | |
fi | |
if [ -e "body" ]; then | |
atvlog --output ${base_name}.html --format markdown body | |
fi | |
- name: Check if log exists | |
id: check_files | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: ${{ env.logfile }} | |
- uses: EndBug/add-and-commit@v7 | |
if: steps.check_files.outputs.files_exists == 'true' | |
with: | |
message: "Add ${{ env.logfile }}" | |
branch: logfiles | |
add: ${{ env.logfile }} | |
- name: Post Status | |
if: steps.check_files.outputs.files_exists == 'true' | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
issue-number: ${{ github.event.issue.number }} | |
body: | | |
Generated html log for ${{ env.source }} is <a href="http://htmlpreview.github.io/?${{ github.server_url }}/${{ github.repository }}/blob/logfiles/${{ env.logfile }}">here</a>. |