Abuse GitHub unpublicized attachment API to serve a file.
Especially useful for hosting image files that can be referenced in markdown files.
- Login to your GitHub account, and obtain cookie named
user_sessionfrom GitHub web browser session. - Install
go install github.com/j178/github-s3/cmd/github-s3@latest
- Run
github-s3 <github-user-session> <path-to-file>
If you don't want to obtain the cookie manually, you can use github-s3-auto to automatically find the cookie from your web browser session.
go install github.com/j178/github-s3/cmd/github-s3-auto@latest github-s3-auto <path-to-file>
jobs: build: runs-on: ubuntu-latest steps: - name: Upload files to GitHub uses: j178/github-s3@master env: GITHUB_USER_SESSION: ${{ secrets.GITHUB_USER_SESSION }} with: files: <list-of-paths-to-file> - name: Use uploaded files run: | # Use the uploaded files with: files: ${{ steps.upload.outputs.links }}
Please note that this project relies on an unpublicized API of GitHub, and its usage may be subject to changes in GitHub's policies or API. Use it responsibly and ensure compliance with GitHub's terms of service.