Skip to content

Replace abandoned third-party actions with inline steps#2032

Merged
mattgodbolt merged 2 commits intomainfrom
replace-abandoned-actions
Mar 12, 2026
Merged

Replace abandoned third-party actions with inline steps#2032
mattgodbolt merged 2 commits intomainfrom
replace-abandoned-actions

Conversation

@mattgodbolt
Copy link
Copy Markdown
Member

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.

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-clean with an inline rm -rf cleanup step across several workflows.
  • Replaced prewk/s3-cp-action with a direct aws s3 cp command 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.

steps:
- name: Clean workspace
uses: AutoModality/action-clean@v1.1.0
run: rm -rf "${{ github.workspace }}"/*
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
run: rm -rf "${{ github.workspace }}"/*
run: |
find "${GITHUB_WORKSPACE:?}" -mindepth 1 -maxdepth 1 -exec rm -rf {} +

Copilot uses AI. Check for mistakes.
steps:
- name: Clean workspace
uses: AutoModality/action-clean@v1.1.0
run: rm -rf "${{ github.workspace }}"/*
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
- name: Start from a clean directory
uses: AutoModality/action-clean@v1.1.0
- name: Clean workspace
run: rm -rf "${{ github.workspace }}"/*
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

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 .[!.]*/..?*).

Suggested change
run: rm -rf "${{ github.workspace }}"/*
run: find "$GITHUB_WORKSPACE" -mindepth 1 -delete

Copilot uses AI. Check for mistakes.
- name: Start from a clean directory
uses: AutoModality/action-clean@v1.1.0
- name: Clean workspace
run: rm -rf "${{ github.workspace }}"/*
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
- name: Start from a clean directory
uses: AutoModality/action-clean@v1.1.0
- name: Clean workspace
run: rm -rf "${{ github.workspace }}"/*
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

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 /*.

Suggested change
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

Copilot uses AI. Check for mistakes.
- name: Start from a clean directory
uses: AutoModality/action-clean@v1.1.0
- name: Clean workspace
run: rm -rf "${{ github.workspace }}"/*
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
run: rm -rf "${{ github.workspace }}"/*
run: find "${GITHUB_WORKSPACE:?}" -mindepth 1 -maxdepth 1 -exec rm -rf {} +

Copilot uses AI. Check for mistakes.
- name: Start from a clean directory
uses: AutoModality/action-clean@v1.1.0
- name: Clean workspace
run: rm -rf "${{ github.workspace }}"/*
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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:?}/"*

Copilot uses AI. Check for mistakes.
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@mattgodbolt mattgodbolt merged commit 04bb382 into main Mar 12, 2026
5 checks passed
@mattgodbolt mattgodbolt deleted the replace-abandoned-actions branch March 12, 2026 23:22
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 this pull request may close these issues.

2 participants