This GitHub Action uploads a single file using a TSD (Services for Sensitive Data) link UUID and secret phrase.
-
Create an import link at: https://selfservice.tsd.usit.no/import-links
You must check "secret", and specifying a PATH on the server is advised. -
Set secrets in your github repository:
SECRET_UUID- The upload link/instance UUIDSECRET_PHRASE- The secret phrase for authentication
Hint: Settings > Security > Secrets and variables > Actions
FILE(required) - Path to the SINGLE file that will be uploaded to the root of the path provided when setting up the import link
status_code- HTTP status code from the upload response
on:
push:
branches: [main]
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Upload file to TSD
uses: LCBC-UIO/tsd-import-action@v2.0.1
env:
SECRET_UUID: ${{ secrets.SECRET_UUID }}
SECRET_PHRASE: ${{ secrets.SECRET_PHRASE }}
with:
FILE: README.mdMake sure to run the upload action only on events that you (or another trusted collaborator) controls, i.e. do not run the import action on any PR as that could allow someone to accidentally or intentioonally overwrite your files. The example above (on push to main) runs the action only when commits are pushed to main (directly or when a PR is merged), not when PRs are opened from other branches/forks.
This action is built with TypeScript and requires Node.js 20.
npm installnpm run buildThis compiles the TypeScript code and bundles it with all dependencies into a single dist/index.js file using @vercel/ncc.
npm testnpm run lint
npm run formatnpm run allThis runs formatting, linting, tests, and builds the action.
- The
dist/folder must be committed to the repository for the GitHub Action to work - Always run
npm run buildafter making changes to the TypeScript source code - The action uses Node.js 20
Version 2.0 represents a rewrite from Python/Docker to TypeScript/Node.js:
- Faster: No Docker container overhead means quicker startup times
- Same API: All inputs and environment variables remain the same
- New output: Now provides
status_codeoutput with the HTTP response code
If you need the Python/Docker version, use @v0.2 in your workflow.
This project was inspired by https://github.com/unioslo/vscode-tsd-sync