Skip to content

ci: pin third-party actions (ninja-i18n, action-discord) to full commit SHAs#8858

Open
kobihikri wants to merge 1 commit into
AppFlowy-IO:mainfrom
kobihikri:harden/pin-thirdparty-actions
Open

ci: pin third-party actions (ninja-i18n, action-discord) to full commit SHAs#8858
kobihikri wants to merge 1 commit into
AppFlowy-IO:mainfrom
kobihikri:harden/pin-thirdparty-actions

Conversation

@kobihikri

@kobihikri kobihikri commented Jul 13, 2026

Copy link
Copy Markdown

What

Pin the two third-party actions currently referenced by mutable tags to their current commit SHA (tag
kept in a trailing comment):

Action Pinned to Where
opral/ninja-i18n-action@main 415e999… ninja_i18n.yml
Ilshidur/action-discord@master d259407… translation_notify.yml

Why

@main/@master are moving references — whatever they point to at run time runs in the job.

  • ninja_i18n.yml runs on pull_request_target and passes GITHUB_TOKEN to the action. pull_request_target
    runs with the base repository's token even for pull requests from forks, so a mutable third-party
    ref here is the most sensitive one to remove.
  • translation_notify.yml passes DISCORD_WEBHOOK to action-discord@master.

If either action's default branch were moved (compromise or an accidental change), the new code would
run with those credentials — the class of issue behind the 2025 tj-actions/changed-files incident.

Scope / safety

  • Behaviour unchanged — each SHA is the current tip of that action's default branch.
  • Only third-party actions are touched; actions/* refs are left as-is. Renovate/Dependabot can still
    bump a SHA pin (the tag comment keeps it readable). Signed-off.

Per GitHub's guidance to pin actions to a full-length commit SHA.

AI-assisted; I verified the workflows, the token/secret exposure, and the pinned SHAs myself.

Summary by Sourcery

Pin third-party GitHub Actions used in CI workflows to specific commit SHAs for improved security and predictability.

CI:

  • Update ninja_i18n workflow to reference opral/ninja-i18n-action by full commit SHA instead of the moving main tag.
  • Update translation_notify workflow to reference Ilshidur/action-discord by full commit SHA instead of the moving master tag.

Pin the two third-party actions referenced by mutable tags to their current
commit SHA (tag kept in a trailing comment):

- opral/ninja-i18n-action@main (ninja_i18n.yml) — runs in a pull_request_target
  workflow and is passed GITHUB_TOKEN
- Ilshidur/action-discord@master (translation_notify.yml) — receives DISCORD_WEBHOOK

A moved tag would run unreviewed code in those jobs. The ninja_i18n one is the
more sensitive: pull_request_target runs with the base repo's token even for
fork PRs. Behaviour unchanged; per GitHub's guidance to pin actions to a
full-length commit SHA.

Signed-off-by: Kobi Hikri <kobi.hikri@gmail.com>
@sourcery-ai

sourcery-ai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Pins two third-party GitHub Actions in CI workflows from mutable branch tags to specific commit SHAs, preserving behavior while hardening credential exposure risk.

File-Level Changes

Change Details Files
Pin the ninja-i18n GitHub Action to a specific commit SHA instead of the mutable main branch reference.
  • Replace opral/ninja-i18n-action@main with opral/ninja-i18n-action@415e999 in the workflow job.
  • Add a trailing comment indicating the original main tag for readability and future maintenance.
.github/workflows/ninja_i18n.yml
Pin the Discord notification GitHub Action to a specific commit SHA instead of the mutable master branch reference.
  • Replace Ilshidur/action-discord@master with Ilshidur/action-discord@d259407 in the workflow job.
  • Add a trailing comment indicating the original master tag for readability and future maintenance.
.github/workflows/translation_notify.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@CLAassistant

CLAassistant commented Jul 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

2 participants