Skip to content

Change docs around ref to point to sha #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 5, 2024
Merged

Change docs around ref to point to sha #330

merged 6 commits into from
Dec 5, 2024

Conversation

GrantBirki
Copy link
Member

This pull request updates and replaces all documentation references of steps.branch-deploy.outputs.ref to steps.branch-deploy.outputs.sha. It also adds detailed docs as to why this is important.

TL;DR

Instead of this:

- name: branch-deploy
  id: branch-deploy
  uses: github/branch-deploy@vX.X.X

- name: checkout
  if: steps.branch-deploy.outputs.continue == 'true'
  uses: actions/checkout@v4
  with:
    ref: ${{ steps.branch-deploy.outputs.ref }} # <-- This is the branch name, can be risky

Do this:

- name: branch-deploy
  id: branch-deploy
  uses: github/branch-deploy@vX.X.X

- name: checkout
  if: steps.branch-deploy.outputs.continue == 'true'
  uses: actions/checkout@v4
  with:
    ref: ${{ steps.branch-deploy.outputs.sha }} # <-- uses an exact commit SHA - safe!

This ensures you are deploying the exact commit SHA that branch-deploy has determined is safe to deploy. This is a best practice for security, reliability, and safety during deployments.

…oy.outputs.ref` to `steps.branch-deploy.outputs.sha` - also adds docs
@GrantBirki GrantBirki self-assigned this Dec 5, 2024
@GrantBirki GrantBirki added the documentation Improvements or additions to documentation label Dec 5, 2024
@GrantBirki GrantBirki merged commit 6b64b4a into main Dec 5, 2024
4 checks passed
@GrantBirki GrantBirki deleted the ref-to-sha branch December 5, 2024 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant