Skip to content

Harden GitHub Actions workflows - #8476

Merged
FreeTubeBot merged 6 commits into
FreeTubeApp:developmentfrom
absidue:workflow-security
Jan 6, 2026
Merged

FreeTubeBot merged 6 commits into
FreeTubeApp:developmentfrom
absidue:workflow-security

Conversation

@absidue

@absidue absidue commented Jan 3, 2026 •

Copy link
Copy Markdown
Member

Pull Request Type

  • Security improvement

Description

This pull request improves the security of our GitHub Actions workflows in quite a few ways:

  • Explicitly set the permissions for the temporary GitHub API token in each job to only the ones that it needs.
  • By default the actions/checkout action persists the credentials used to clone the repo in the git config so that they can be used by other git commands, but as we don't run any other git commands in most workflows we don't need those credentials to be persisted. In the workflows that we do need the credentials for further git commands, we explicitly enable persisting the credentials, so that it is clear what is happening.
  • Pass the GITHUB_TOKEN to the GitHub CLI in the flatpak workflow with the GH_TOKEN environment variable like we do in the auto merge workflow, instead of writing it to the disk.
  • Pin the used actions to specific commits with the version in a comment, to avoid us potentially picking up malicious re-releases of existing versions of those actions. Dependabot will still run and update both the commit and version comment according to its documentation.
  • Explicitly set the shell for all scripts that we run instead of relying on the default. That makes the scripts predictable and in the case of bash also more secure as it stops it loading the .bashrc and .bash_profile files.
  • Enable CodeQL code scanning for our GitHub Actions workflows

Additional context

I will work on replacing some of the simple third-party actions that we are using with shell commands or API calls with the GitHub CLI in a follow up.

@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jan 3, 2026
@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) January 3, 2026 13:02
@github-advanced-security

Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@FreeTubeBot
FreeTubeBot merged commit efef238 into FreeTubeApp:development Jan 6, 2026
@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jan 6, 2026
@absidue
absidue deleted the workflow-security branch January 6, 2026 06:33
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Jan 7, 2026
* development: (26 commits)
  Use bash even in workflows that run on Windows (FreeTubeApp#8493)
  Translated using Weblate (Malay)
  fix refresh (FreeTubeApp#8475)
  Harden GitHub Actions workflows (FreeTubeApp#8476)
  Update copyright year to 2026 (FreeTubeApp#8487)
  Added translation using Weblate (Malay)
  Bump globals from 16.5.0 to 17.0.0 (FreeTubeApp#8484)
  Bump vue-i18n from 11.2.7 to 11.2.8 (FreeTubeApp#8483)
  Translated using Weblate (Welsh)
  Bump qs from 6.14.0 to 6.14.1 (FreeTubeApp#8471)
  Translated using Weblate (Estonian)
  Bump lefthook from 2.0.12 to 2.0.13 (FreeTubeApp#8461)
  Translated using Weblate (Dutch)
  Fix DeArrow thumbnails for shorts getting stretched (FreeTubeApp#8434)
  Clean up FtSlider CSS (FreeTubeApp#8438)
  Migrate the GeneralSettings component to the composition API (FreeTubeApp#8439)
  Translated using Weblate (English (United Kingdom))
  Bump vue-i18n from 11.2.2 to 11.2.7 (FreeTubeApp#8451)
  Bump electron-builder from 26.3.6 to 26.4.0 (FreeTubeApp#8446)
  Bump lefthook from 2.0.11 to 2.0.12 (FreeTubeApp#8449)
  ...
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.

5 participants