W3C Web Authentication: An API for accessing Public Key Credentials, Level 2, Jeff Hodges et al, April 2021 (W3C Recommendation) #33
This file contains hidden or 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: Convert Locked Issues to Markdown | |
on: | |
issues: | |
types: [labeled] | |
permissions: | |
contents: write | |
jobs: | |
issue_to_markdown: | |
if: contains(github.event.label.name, 'locked') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: feat/capture-issues | |
- name: Convert Issue to Markdown | |
id: convert | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
run: | | |
issue_number=${{ github.event.issue.number }} | |
curl -s -H "Authorization: token $GITHUB_TOKEN" \ | |
https://api.github.com/repos/${{ github.repository }}/issues/$issue_number/comments \ | |
> comments.json | |
mkdir -p issues | |
echo "# ${{ github.event.issue.title }}" > issues/issue-$issue_number.md | |
echo "\n\n${{ github.event.issue.body }}" >> issues/issue-$issue_number.md | |
echo "\n## Comments" >> issues/issue-$issue_number.md | |
cat comments.json | |
if jq -e . >/dev/null 2>&1 < comments.json; then | |
jq -r '.[] | "\n### \(.user.login) commented:\n \(.body)"' comments.json >> issues/issue-$issue_number.md | |
mv comments.json issues/issue-$issue_number-comments.json | |
else | |
echo "\nNo comments available." >> issues/issue-$issue_number.md | |
fi | |
- name: Commit Markdown | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email 'github-actions@github.com' | |
git checkout feat/capture-issues | |
git add issues/ | |
git commit -m "Convert locked issue ${{ github.event.issue.number }} to markdown" | |
git push origin feat/capture-issues |