In the past, using CFX Keymaster made it impossible to build CI/CD pipelines for Escrow Resources due to the Cloudflare Bot Challenge.
However, CFX has now created a new platform called "Portal", which is still secured via Cloudflare but operates in a less restrictive attack mode, enabling its use within a GitHub Action.
To use this action, you need to authenticate via the forum using a cookie until CFX provides API keys for this action.
-
Go to the CFX Forum and inspect the site using your browser's developer tools.
-
Navigate to the Cookies section and search for
_t
. -
Copy the value of this cookie and save it in GitHub Secrets as
FORUM_COOKIE
. -
Use the action in your workflow (remember to checkout before!):
- name: Upload Escrow Resource uses: Tynopia/cfx-portal-upload with: cookie: ${{ secrets.FORUM_COOKIE }} assetName: 'my_asset'
Important
When you log out of the forum, the cookie will become invalid, causing the action to fail. After configuring the secret, you should clear the cookie from your browser and log in again to avoid potential issues.
Key | Type | Value | Description |
---|---|---|---|
cookie | string | The Forum Cookie to authenticate | Go to forum.cfx.re and inspect the page with your browser's dev tools. Then search for the _t cookie. |
makeZip | boolean? | Automatically ZIP the full repository to upload it (default: true) | This will remove the folders .git/ /.github/ /.vscode/ from the repository before zipping. |
assetName | string | The asset name to re-upload | This is the name of the asset you want to re-upload. |
assetId | number | The Asset ID, which is a unique ID in the portal | The Asset ID can be found at portal.cfx.re. ![]() |
zipPath | string? | The path to your ZIP file that should be uploaded | This is the file location of your packed ZIP file inside the Workflow Container, usually stored in /home/... . |
maxRetries | number? | The maximum number of retries. (default: 3) | This is the maximum number of times the login will be retried if it fails. |
chunkSize | number? | How large one chunk is for upload. Default: 2097152 bytes |
Note
?
after the type indicates that the parameter is optional. if no assetName
or assetId is provided, the repository name will be used as assetName.
If you want to contribute to this project, you can fork the repository and create a pull request:
- Fork the repository.
- Clone your forked repository.
- Create a new branch.
- Make your changes.
- Push the changes to your fork.
- Create a pull request.
Contributing helps the CFX community and improves the experience for everyone.
Note
Currently, the project does not have complete unit test coverage. If you want to contribute, adding unit tests would be a great starting point.