Replace abandoned third-party actions with inline steps#2032
Replace abandoned third-party actions with inline steps#2032mattgodbolt merged 2 commits intomainfrom
Conversation
AutoModality/action-clean (last commit 2021) pulled a Docker image just to run rm -rf. Replace with an inline shell step. prewk/s3-cp-action (last commit 2021, uses Python 3.8 and AWS CLI 1.17.1) wrapped a single aws s3 cp call. Replace with a direct run step using the CLI already available on the runners. The remaining third-party action (owenthereal/action-upterm) is actively maintained and will likely get a Node 24 update soon. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates multiple GitHub Actions workflows to remove reliance on abandoned third-party actions by replacing them with inline shell steps for workspace cleanup and S3 uploads, aligning the workflows with tools already available on the runners.
Changes:
- Replaced
AutoModality/action-cleanwith an inlinerm -rfcleanup step across several workflows. - Replaced
prewk/s3-cp-actionwith a directaws s3 cpcommand using runner-provided AWS CLI.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/install.yml | Replaces third-party workspace clean action with inline cleanup step. |
| .github/workflows/consolidate.yml | Replaces third-party workspace clean action with inline cleanup step. |
| .github/workflows/cefs-gc.yml | Replaces third-party workspace clean action with inline cleanup step. |
| .github/workflows/bespoke-build.yaml | Replaces workspace clean action; replaces S3 copy action with direct AWS CLI call. |
| .github/workflows/bespoke-build-arm64.yaml | Replaces workspace clean action; replaces S3 copy action with direct AWS CLI call. |
| .github/workflows/adhoc-command.yml | Replaces third-party workspace clean action with inline cleanup step. |
| .github/workflows/adhoc-command-lin-builder.yml | Replaces third-party workspace clean action with inline cleanup step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/adhoc-command.yml
Outdated
| steps: | ||
| - name: Clean workspace | ||
| uses: AutoModality/action-clean@v1.1.0 | ||
| run: rm -rf "${{ github.workspace }}"/* |
There was a problem hiding this comment.
rm -rf "${{ github.workspace }}"/* won’t remove dotfiles/directories, so the workspace may still contain .git and other hidden state from prior runs. Consider a safer full cleanup of $GITHUB_WORKSPACE contents (including dotfiles) with a guard (e.g. ${GITHUB_WORKSPACE:?}) to avoid accidental rm -rf /* if the workspace path is ever empty/unexpected.
| run: rm -rf "${{ github.workspace }}"/* | |
| run: | | |
| find "${GITHUB_WORKSPACE:?}" -mindepth 1 -maxdepth 1 -exec rm -rf {} + |
| steps: | ||
| - name: Clean workspace | ||
| uses: AutoModality/action-clean@v1.1.0 | ||
| run: rm -rf "${{ github.workspace }}"/* |
There was a problem hiding this comment.
This cleanup only targets non-hidden entries; dotfiles like .git remain and can leak state between runs on the self-hosted runner. Suggest switching to a full workspace cleanup that includes dotfiles and guarding against an empty/mis-set workspace path.
| run: rm -rf "${{ github.workspace }}"/* | |
| run: | | |
| ws="${{ github.workspace }}" | |
| if [ -n "$ws" ] && [ "$ws" != "/" ]; then | |
| find "$ws" -mindepth 1 -maxdepth 1 -exec rm -rf {} + | |
| else | |
| echo "Refusing to clean: invalid workspace path '$ws'" >&2 | |
| exit 1 | |
| fi |
.github/workflows/install.yml
Outdated
| - name: Start from a clean directory | ||
| uses: AutoModality/action-clean@v1.1.0 | ||
| - name: Clean workspace | ||
| run: rm -rf "${{ github.workspace }}"/* |
There was a problem hiding this comment.
rm -rf "${{ github.workspace }}"/* does not remove dotfiles/directories (e.g. .git, .github, etc.), so the workspace may not actually be clean on self-hosted runners and could leak state between runs. Consider switching to a pattern that deletes all entries under the workspace (including dotfiles) without removing the workspace directory itself (e.g. find "$GITHUB_WORKSPACE" -mindepth 1 -delete, or a guarded rm that includes .[!.]*/..?*).
| run: rm -rf "${{ github.workspace }}"/* | |
| run: find "$GITHUB_WORKSPACE" -mindepth 1 -delete |
.github/workflows/consolidate.yml
Outdated
| - name: Start from a clean directory | ||
| uses: AutoModality/action-clean@v1.1.0 | ||
| - name: Clean workspace | ||
| run: rm -rf "${{ github.workspace }}"/* |
There was a problem hiding this comment.
rm -rf "${{ github.workspace }}"/* won’t delete dotfiles (including .git), so this isn’t equivalent to the prior clean action and can leave stale state on self-hosted runners. Use a cleanup approach that removes all contents (including dotfiles) under the workspace, ideally with a guard against an empty/incorrect workspace path.
| run: rm -rf "${{ github.workspace }}"/* | |
| run: | | |
| if [ -n "${{ github.workspace }}" ] && [ -d "${{ github.workspace }}" ]; then | |
| find "${{ github.workspace }}" -mindepth 1 -maxdepth 1 -exec rm -rf {} + | |
| fi |
.github/workflows/cefs-gc.yml
Outdated
| - name: Start from a clean directory | ||
| uses: AutoModality/action-clean@v1.1.0 | ||
| - name: Clean workspace | ||
| run: rm -rf "${{ github.workspace }}"/* |
There was a problem hiding this comment.
This cleanup command only deletes non-hidden entries; dotfiles like .git will remain and can cause non-deterministic behavior on self-hosted runners across jobs. Suggest deleting all workspace children (including dotfiles) and adding a safety guard so an unexpected empty workspace path can’t turn into rm -rf /*.
| run: rm -rf "${{ github.workspace }}"/* | |
| run: | | |
| workspace="${{ github.workspace }}" | |
| if [ -n "$workspace" ] && [ "$workspace" != "/" ]; then | |
| # Remove all contents, including dotfiles, but not the workspace directory itself | |
| rm -rf "${workspace:?}/"* | |
| rm -rf "${workspace:?}"/.[!.]* "${workspace:?}"/..?* || true | |
| else | |
| echo "Refusing to clean invalid workspace path: '$workspace'" | |
| exit 1 | |
| fi |
.github/workflows/bespoke-build.yaml
Outdated
| - name: Start from a clean directory | ||
| uses: AutoModality/action-clean@v1.1.0 | ||
| - name: Clean workspace | ||
| run: rm -rf "${{ github.workspace }}"/* |
There was a problem hiding this comment.
rm -rf "${{ github.workspace }}"/* doesn’t remove dotfiles/directories (notably .git), so the runner may keep state between runs. Consider using $GITHUB_WORKSPACE with a non-empty guard (e.g. ${GITHUB_WORKSPACE:?}) and a deletion method that removes all children (including dotfiles) without deleting the workspace itself.
| run: rm -rf "${{ github.workspace }}"/* | |
| run: find "${GITHUB_WORKSPACE:?}" -mindepth 1 -maxdepth 1 -exec rm -rf {} + |
| - name: Start from a clean directory | ||
| uses: AutoModality/action-clean@v1.1.0 | ||
| - name: Clean workspace | ||
| run: rm -rf "${{ github.workspace }}"/* |
There was a problem hiding this comment.
The workspace cleanup here only removes non-hidden files; dotfiles (like .git) remain and can affect subsequent actions/checkout behavior on self-hosted runners. Recommend deleting all workspace contents (including dotfiles) and guarding against an empty workspace variable to prevent accidental deletion outside the intended directory.
| run: rm -rf "${{ github.workspace }}"/* | |
| shell: bash | |
| run: | | |
| if [ -z "${GITHUB_WORKSPACE}" ]; then | |
| echo "GITHUB_WORKSPACE is not set; refusing to clean workspace." | |
| exit 1 | |
| fi | |
| if [ ! -d "${GITHUB_WORKSPACE}" ]; then | |
| echo "GITHUB_WORKSPACE directory does not exist; refusing to clean workspace." | |
| exit 1 | |
| fi | |
| shopt -s dotglob | |
| rm -rf "${GITHUB_WORKSPACE:?}/"* |
The rm -rf glob didn't remove dotfiles like .git, so stale hidden state could persist between runs on self-hosted runners. Use find with -delete instead, matching the original action-clean behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AutoModality/action-clean (last commit 2021) pulled a Docker image just to run rm -rf. Replace with an inline shell step.
prewk/s3-cp-action (last commit 2021, uses Python 3.8 and AWS CLI 1.17.1) wrapped a single aws s3 cp call. Replace with a direct run step using the CLI already available on the runners.
The remaining third-party action (owenthereal/action-upterm) is actively maintained and will likely get a Node 24 update soon.