Skip to content
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

Jobs with multiple steps will not fail if the last step is pinned #133

Closed
wadells opened this issue Nov 28, 2023 · 1 comment · Fixed by #132
Closed

Jobs with multiple steps will not fail if the last step is pinned #133

wadells opened this issue Nov 28, 2023 · 1 comment · Fixed by #132

Comments

@wadells
Copy link
Contributor

wadells commented Nov 28, 2023

When a workflow has both pinned and unpinned steps, only the status of the final step is used to determine if the overall job should pass or fail. Consider the following workflow:

on:
  push:

name: Continuous Integration

jobs:
  check-github-actions:
    name: Check GitHub Actions
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Ensure SHA pinned actions
        uses: zgosalvez/github-actions-ensure-sha-pinned-actions@b35f285b9bb7e80de0967367cee66d3b6d50ceca # v3.0.1

This will pass because zgosalvez/github-actions-ensure-sha-pinned-actions is pinned (and the last step), whereas the earlier actions/checkout should cause the job to fail. If a 2nd actions/checkout@v4 is added after the pinned step, the job will no longer pass.

Tested using v3.0.1.

@wadells
Copy link
Contributor Author

wadells commented Nov 28, 2023

I believe this was introduced in #127, where jobHasError was added.

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 a pull request may close this issue.

1 participant