Skip to content

Conversation

SgtPooki
Copy link
Collaborator

@SgtPooki SgtPooki commented Sep 30, 2025

Re-usable github action.. Example usage in filecoin-project/lotus-docs#821

Summary

  • Adds a reusable composite GitHub Action (filecoin-pin-upload-action) that can run end-to-end or in a two-step prepare/upload flow.
  • Includes helper modules (inputs.js, cache.js, filecoin.js, outputs.js, errors.js) for clarity, plus comprehensive README guidance on security, permissions, and workflows.

Details

  • minimal requirement for setup
  • README updates:
    • Setup checklist (pin by commit SHA, restrict allowed actions, grant actions: read, cap maxTopUp, use environments, protect workflows).
    • PR safety options (low/zero top-up, label-gated, two-step).
    • Two-step & single usage examples.

Fixes #49

@SgtPooki SgtPooki linked an issue Sep 30, 2025 that may be closed by this pull request
3 tasks
@SgtPooki SgtPooki requested a review from BigLep September 30, 2025 19:54
@SgtPooki
Copy link
Collaborator Author

Copy link
Member

@BigLep BigLep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good for me to look with a fresh head, but here some things coming to midn. Thanks for working on this and helping tease out UX things.

providerAddress:
description: Optional override for storage provider address (on Calibration/Mainnet). Defaults to a known good provider on Calibration.
required: false
default: "0xa3971A7234a3379A1813d9867B531e7EeB20ae07"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about default to using Synapse's default rather than encoding something here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is primarily for testing: ezpzdz was claimed by someone in slack to be "the most reliable" and I've also noticed the same since I started using it... This should be removed from any prod version

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Maybe then to make it clear, we just prefix it with some lime "internal" or "temp"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe discuss the failure cases that can occur that will fail the action?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be covered by FLOW and USAGE now, but we can add into README if we want. there is also src/errors.js that has some common errors we can call out.

@BigLep
Copy link
Member

BigLep commented Oct 1, 2025

Things I would also want to make sure are in the logs are:

  • Current deposited balance
  • Runway of dataset given current amount deposited
  • Whether any amount was deposited and how much
  • Size of current artifact that was uploaded

providerAddress:
description: Optional override for storage provider address (on Calibration/Mainnet). Defaults to a known good provider on Calibration.
required: false
default: "0xa3971A7234a3379A1813d9867B531e7EeB20ae07"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is primarily for testing: ezpzdz was claimed by someone in slack to be "the most reliable" and I've also noticed the same since I started using it... This should be removed from any prod version

default: "0xa3971A7234a3379A1813d9867B531e7EeB20ae07"

outputs:
root_cid:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Filecoin Pin Upload ✅',
'',
'- IPFS Root CID: `' + IPFS_ROOT_CID + '`',
'- Data Set ID: `' + DATA_SET_ID + '`',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea its at https://pdp.vxb.ai/calibration. I can add it.

${{ steps.run.outputs.metadata_path || steps.from-cache.outputs.metadata_path || steps.from-artifact.outputs.metadata_path }}

- name: Comment on PR with IPFS Root CID
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command in particular is safe, because it doesn't have access to secrets, but the action does need to be split up into a two workflow process. I am working on that now

@BigLep
Copy link
Member

BigLep commented Oct 2, 2025

Things I would also want to make sure are in the logs are:

  • Current deposited balance
  • Runway of dataset given current amount deposited
  • Whether any amount was deposited and how much
  • Size of current artifact that was uploaded

These would great things to see in the upload job output like https://github.com/SgtPooki/fwss-simple-static-website/actions/runs/18198348463/attempts/2#summary-51810985939

It would also be great if the PR comment linked to this job artifact so someone can see more details

@SgtPooki
Copy link
Collaborator Author

SgtPooki commented Oct 6, 2025

FYI this is now working at https://github.com/filecoin-project/filecoin-pin-github-action-test/actions/runs/18283219700/job/52051743238.

will work on renaming now and cleaning up usage so its used with filecoin-project/filecoin-pin/.github/actions/[email protected] or similar. If we want a better name, we could open in a separate repo, so users could target filecoin-project/[email protected] or whatever name we want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: GitHub Action for Filecoin Pin Uploads
2 participants