Skip to content

Use OctoSTS for raising PRs; upgrade actions; run zizmor#25

Open
BehnH wants to merge 5 commits intomainfrom
behn/IDE-2946/use-octosts-for-raising-prs
Open

Use OctoSTS for raising PRs; upgrade actions; run zizmor#25
BehnH wants to merge 5 commits intomainfrom
behn/IDE-2946/use-octosts-for-raising-prs

Conversation

@BehnH
Copy link
Copy Markdown
Member

@BehnH BehnH commented Mar 24, 2026

Switch to using OctoSTS with a local trust policy in order to prevent having to close & re-open PRs, since GitHub actions isn't able to trigger it's own workflows. Also upgrade & pin actions versions, then run Zizmor against the workflow files for static analysis of actions code.

@BehnH BehnH force-pushed the behn/IDE-2946/use-octosts-for-raising-prs branch from e6edd1f to 994211f Compare March 24, 2026 11:13
@BehnH BehnH marked this pull request as ready for review March 24, 2026 11:14
@BehnH BehnH requested a review from a team as a code owner March 24, 2026 11:14
@BehnH BehnH force-pushed the behn/IDE-2946/use-octosts-for-raising-prs branch from 994211f to 856e5a9 Compare March 24, 2026 11:22
@BehnH BehnH force-pushed the behn/IDE-2946/use-octosts-for-raising-prs branch from 856e5a9 to 28c4480 Compare March 24, 2026 11:53
@BehnH BehnH requested a review from a team March 24, 2026 14:00
- name: Upload Results
if: steps.benchmarks.outcome == 'success'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We'll want to pin all the SHAs, and include a comment of the specific version.

Suggested change
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@c6a366c94c3e0affe28c06c8df20a878f24da3cf # 7.0.0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I hadn't pinned these since we don't enforce pinning actions from GitHub's official actions org. I'm happy to pin absolutely everything though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We've been pinning basically everything, but if our general guidance is going to not be pinning official actions, then I could see that.

@kinyoklion
Copy link
Copy Markdown
Member

Is there some background information for this change. The go update pattern is replicated between a few repositories, so I would like a better understanding of goals.

This feels like it could also be useful for a problem we have with the flutter repository. Flutter requires releases be from tags, and we create out tags with a CI job, which then cannot run the flutter publish job. In that case we have to use a PAT for publishing, but maybe we could use this approach instead.

@BehnH
Copy link
Copy Markdown
Member Author

BehnH commented Mar 25, 2026

Is there some background information for this change. The go update pattern is replicated between a few repositories, so I would like a better understanding of goals.

Sure, so when GitHub Actions opens a PR, Actions on that PR do not run until the PR is closed & re-opened by a human actor. There is, however, a way to avoid that step - and that is to either use a Personal (or fine-grained) access token (not ideal, they're long-lived) or use a token generated by a GitHub App.

OctoSTS enables creating a short-lived GitHub App token, using permissions defined in a policy file (in this case, .github/launchdarkly/self.bump-go-versions.sts.yaml) which limits the scope of the token. Policies defined in this repo allow the token to execute operations against it - we do have the ability to create globally scoped policies too. I didn't personally realize we replicated this pattern across a few more places, but there's absolutely no reason why we couldn't replicate it there too.

If you look at the this workflow file, you can see how we use OctoSTS to generate a short-lived token which can publish releases.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

permissions:
contents: write
issues: write
pull-requests: write
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unnecessary workflow-level permission overridden by job-level permissions

Low Severity

The newly added workflow-level permissions block includes issues: write, but the only job (release-please) defines its own permissions block (with just contents: write and pull-requests: write), which completely overrides the workflow-level permissions. The issues: write permission has no effect on any job. Given this PR's goal of tightening security posture via zizmor, adding an unused broad permission at the workflow level is counterproductive — it could mislead future contributors into thinking issues: write is needed, and any new job added without its own permissions block would unexpectedly inherit it.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is likely because we added the job level permissions to main between the opening of this PR and now, so this is redundant now.

I do generally agree that job level permissions are better than workflow level permissions. Especially being as some jobs execute in repo code and other jobs do not.

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