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

Check that file exists before attempting to move it #368

Closed
wants to merge 1 commit into from

Conversation

jsf9k
Copy link
Member

@jsf9k jsf9k commented Aug 7, 2024

🗣 Description

This pull request modifies the GitHub workflows to verify that /usr/local/bin/packer exists before attempting to mv it.

💭 Motivation and context

Packer is not preinstalled on the ubuntu-24.04 runner image, for example, so the previous code will result in an error there.

🧪 Testing

This change was tested as part of cisagov/freeipa-server-packer#133.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

Packer is not preinstalled on the ubuntu-24.04 runner image, for
example, so the previous code will result in an error there.
@jsf9k jsf9k added bug This issue or pull request addresses broken functionality github-actions Pull requests that update GitHub Actions code kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release labels Aug 7, 2024
@jsf9k jsf9k self-assigned this Aug 7, 2024
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

👍

@jsf9k jsf9k marked this pull request as ready for review August 7, 2024 17:30
@jsf9k jsf9k requested a review from a team August 7, 2024 17:30
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

LGTM ✔

@@ -115,7 +115,10 @@ jobs:
"https://releases.hashicorp.com/packer/${PACKER_VERSION}/${PACKER_ZIP}"
sudo unzip -d /opt/packer \
${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}"
sudo mv /usr/local/bin/packer /usr/local/bin/packer-default
if [ -e /usr/local/bin/packer ]
Copy link
Member

Choose a reason for hiding this comment

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

Would you please backport this to cisagov/skeleton-generic? I believe this will start to be a problem as ubuntu-latest is starting to use ubuntu-24.04 with a GA this month based on actions/runner-images#9691 (comment).

@jsf9k
Copy link
Member Author

jsf9k commented Aug 8, 2024

@mcdonnnj found a hashicorp/setup-packer action that will handle this for us, so we will use that instead of the changes in this PR.

@jsf9k jsf9k closed this Aug 8, 2024
@jsf9k jsf9k deleted the bugfix/check-existence-before-mv branch August 9, 2024 13:44
@mcdonnnj
Copy link
Member

@mcdonnnj found a hashicorp/setup-packer action that will handle this for us, so we will use that instead of the changes in this PR.

This can be found in cisagov/skeleton-generic#187.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request addresses broken functionality github-actions Pull requests that update GitHub Actions code kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants