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.
- Make a change here
- Go to https://.com/TomasHubelbauer/-issues-git-notes-demo/actions/workflows/main.yml
- 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.