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

🧪 Use prefetched action to make trampoline #293

Merged

Conversation

webknjaz
Copy link
Member

@webknjaz webknjaz commented Nov 6, 2024

Previously, the action repository was being cloned from the remote
twice, unnecessarily. This patch eliminates this step and
uses the copy that was checked out on job start.

The generated trampoline action is still copied into the allowlisted
working directory so it can be referenced by the relative path
starting with ./.

It is now output under
./.github/.tmp/.generated-actions/run-pypi-publish-in-docker-container
which mutates the end-user's workspace slightly but uses a path that
is unlikely to clash with somebody else's use.

Unfortunately, we cannot use randomized paths because the composite
action syntax does not allow accessing variables in uses:.

Fixes #292.

@webknjaz webknjaz added the bug Something isn't working label Nov 6, 2024
@webknjaz webknjaz self-assigned this Nov 6, 2024
@webknjaz
Copy link
Member Author

webknjaz commented Nov 6, 2024

Let's see if this works...

@webknjaz webknjaz force-pushed the bugfixes/uncheckout-intermediate-action branch 2 times, most recently from d28dbf0 to fa84826 Compare November 6, 2024 14:41
Previously, the action repository was being cloned from the remote
twice, unnecessarily. This patch eliminates this step and
uses the copy that was checked out on job start.

The generated trampoline action is still copied into the allowlisted
working directory so it can be referenced by the relative path
starting with `./`.

It is now output under
`./.github/.tmp/.generated-actions/run-pypi-publish-in-docker-container`
which mutates the end-user's workspace slightly but uses a path that
is unlikely to clash with somebody else's use.

Unfortunately, we cannot use randomized paths because the composite
action syntax does not allow accessing variables in `uses:`.

Fixes pypa#292.
@webknjaz webknjaz force-pushed the bugfixes/uncheckout-intermediate-action branch from fa84826 to dfcfeca Compare November 6, 2024 14:47
@webknjaz webknjaz changed the title 🧪Reuse existing action checkout as trampoline 🧪 Use prefetched action to make trampoline Nov 6, 2024
@webknjaz
Copy link
Member Author

webknjaz commented Nov 6, 2024

@br3ndonland I'm merging this now but please comment post-merge if you notice any flaws in my approach.

@webknjaz webknjaz merged commit 0a87186 into pypa:unstable/v1 Nov 6, 2024
5 checks passed
@webknjaz webknjaz linked an issue Nov 6, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use v1.12.0 on Github Enterprise No Such File or Directory
1 participant