TomasHubelbauer/-issues-git-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

This Action stores the API payload from the GET /issues API call into the Git notes ref of the repository it has run for.

This repository implements a Actions that takes the Issues (backed by the database not the Git objects) of the repository it runs on using the API and stores the JSON in the Git repository's Git Notes.

This action should be run on all issues & issue_comment trigger events. demo.

Git notes are pushed back to the repository using git push origin refs/notes/* and with the Actions Git identity.

The note is added to the repository's default branch's ref, associated to the branch's tip commit. If the workflow runs multiple times for the same commit, it will update the note for that commit.

Git notes can be fetched locally by using git fetch with the notes ref: git fetch origin "+refs/notes/*:refs/notes/*". This will replace local notes.

To view notes for the main branch, run the Git log command with %N format: git log --pretty=format:"%ai%n %H%n %s%n %N%n" --show-notes main.

./workflows/main.yml:

name: main
on:
  issues:
  issue_comment:

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
    - name: Back up  Issues to Git notes
      uses: tomashubelbauer/-issues-git-notes@main

You can see this in action (pun intended) in this repository: https://.com/TomasHubelbauer/-issues-git-notes-demo

I have not published this Action to the Marketplace.

  1. Make a change here
  2. Go to https://.com/TomasHubelbauer/-issues-git-notes-demo/actions/workflows/main.yml
  3. Click Run workflow

I am not likely to accept contributions unless they benefit my use-case.

Feel free to fork the action and adjust it to suit your needs.

About

A Actions action to sync Issues to Git notes

Topics

Resources

Stars

Watchers

Forks