Action that will snapshot a GitHub Project 2.0 The tool uploads the project data as a workflow artifact. These are subject to data retention policies (defaults to 90 days but is confiurable). If these need to be stored for a longer term then you can download the artifacts in another step and then save them somewhere.
Note: This relies on timrogers/gh-migrate-project and therefore has the following caveats
This tool can't migrate so-called classic Projects - only the newer version of GitHub Projects.
Classic Projects can be migrated with GitHub Enterprise Importer or ghe-migrator.
The following data is not migrated and will be skipped:
- Views
- The order of project items displayed in your views
- Workflows
- Iteration custom fields
- Draft issues' assignees
Migrated draft issues will show as being created by the person who ran the migration at the time they ran the migration. A note will be prepended to the body with original author login and timestamp.
- Find your Project ID This can be done by inspecting the URL and grabbing the number
- Create your workflow, below is an example on how to do this on demand for a fixed project
name: Test Action
on:
workflow_dispatch:
jobs:
snapshot:
runs-on: ubuntu-latest
steps:
- uses: chocrates/snapshot-project@main
with:
project-owner: chocrates-test-org
project-id: 11
pat: ${{ secrets.PAT }}If you find yourself needing to restore your project then you can use the following steps. You can find the original steps, these should be considered the source of truth and this README could get out of date depending on updates to the tool
- Install the gh Migrate Project CLI extension
gh extension install timrogers/gh-migrate-project
- Download your archive of the snapshot
- Unzip your snapshot into your folder
[snapshot-project] unzip ~/Downloads/project-11-snapshot-2024-02-15.19.29.35.zip
Archive: /home/chris/Downloads/project-11-snapshot-2024-02-15.19.29.35.zip
inflating: project.json
inflating: repository-mappings.csv
- Edit the
repository-mappings.csvas needed - Import the project. Note this won't let you update an existing project, you will have to import the snapshot into a new project
gh migrate-project import --access-token <GitHub PAT> --project-owner <Target Organization> \
--input-path project.json --repository-mappings-path repository-mappings.csv \
--project-title "<Title of new Project>"
