Skip to content

chore!: Checkout action using action_ref#163

Closed
Mrtenz wants to merge 5 commits into
mainfrom
mrtenz/action-ref
Closed

chore!: Checkout action using action_ref#163
Mrtenz wants to merge 5 commits into
mainfrom
mrtenz/action-ref

Conversation

@Mrtenz
Copy link
Copy Markdown
Member

@Mrtenz Mrtenz commented Nov 20, 2025

This changes all instances where we need to reference another action in github-tools to use a local checkout in the .github-tools directory, using github.action_ref as ref. This ensures we check out a compatible version, since github.action_ref will be set to the ref that was used to call github-tools in the first place.


Note

Standardizes all GitHub workflows/actions to locally checkout github-tools to ./.github-tools using github.action_repository and github.action_ref, updating paths and scripts accordingly, and adds a composite changelog check action.

  • CI/Workflows:
    • Replace remote MetaMask/github-tools refs (and pinned SHAs) with local checkout: actions/checkout@v5 of ${{ github.action_repository }}@${{ github.action_ref }} into ./.github-tools.
    • Update paths to ./.github-tools for Node setup, Corepack/Yarn, working directories, and script execution across changelog-check, create-release-pr, flaky-test-report, get-release-timelines, post-merge-validation, publish-slack-release-testing-status, remove-rca-needed-label-sheets, stable-sync, and update-release-changelog.
    • Adjust .gitignore handling in stable-sync to ignore ./.github-tools/.
  • Actions:
    • Add composite action ./.github/actions/changelog-check using local ./.github-tools checkout.
    • setup-e2e-env: use local ./.github-tools/.github/actions/configure-keystore.
  • Scripts:
    • create-platform-release-pr.sh: invoke version/update helpers from ./.github-tools, update working directories and messaging; fix directory names.
  • Tests:
    • Update mocks and paths in test-create-platform-release-pr-full.sh to ./.github-tools.
  • Misc:
    • Minor formatting/whitespace tweaks; upgrade some actions/checkout to v5.

Written by Cursor Bugbot for commit b0fd4a8. This will update automatically on new commits. Configure here.

- run: echo "Setup E2E Environment started"
shell: bash

- name: Checkout GitHub tools repository
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added this so we can use the local checkout below instead of referencing github-tools by commit.

@Mrtenz Mrtenz marked this pull request as ready for review November 20, 2025 10:23
path: github-tools
repository: ${{ github.action_repository }}
ref: ${{ github.action_ref }}
path: ./.github-tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Using action_ref in workflow_call contexts unavailable

The github.action_repository and github.action_ref context variables are not available in workflow_call contexts. These variables are only populated when steps use composite actions, not when workflows are called directly. This checkout step will fail with empty values. These workflows need either to be called as actions (not workflows) or use a different mechanism to obtain the correct ref.

Fix in Cursor Fix in Web

path: github-tools
repository: ${{ github.action_repository }}
ref: ${{ github.action_ref }}
path: ./.github-tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Using action_ref in workflow_call contexts unavailable

The github.action_repository and github.action_ref context variables are not available in workflow_call contexts. These variables are only populated when steps use composite actions, not when workflows are called directly. This checkout step will fail with empty values. These workflows need either to be called as actions (not workflows) or use a different mechanism to obtain the correct ref.

Fix in Cursor Fix in Web

path: github-tools
repository: ${{ github.action_repository }}
ref: ${{ github.action_ref }}
path: ./.github-tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Using action_ref in workflow_call contexts unavailable

The github.action_repository and github.action_ref context variables are not available in workflow_call contexts. These variables are only populated when steps use composite actions, not when workflows are called directly. This checkout step will fail with empty values. These workflows need either to be called as actions (not workflows) or use a different mechanism to obtain the correct ref.

Fix in Cursor Fix in Web

repository: metamask/github-tools
repository: ${{ github.action_repository }}
ref: ${{ github.action_ref }}
path: ./.github-tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Using action_ref in workflow_call contexts unavailable

The github.action_repository and github.action_ref context variables are not available in workflow_call contexts. These variables are only populated when steps use composite actions, not when workflows are called directly. This checkout step will fail with empty values. These workflows need either to be called as actions (not workflows) or use a different mechanism to obtain the correct ref.

Fix in Cursor Fix in Web

path: github-tools
repository: ${{ github.action_repository }}
ref: ${{ github.action_ref }}
path: ./.github-tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Using action_ref in workflow_call contexts unavailable

The github.action_repository and github.action_ref context variables are not available in workflow_call contexts. These variables are only populated when steps use composite actions, not when workflows are called directly. This checkout step will fail with empty values. These workflows need either to be called as actions (not workflows) or use a different mechanism to obtain the correct ref.

Fix in Cursor Fix in Web

path: github-tools
repository: ${{ github.action_repository }}
ref: ${{ github.action_ref }}
path: ./.github-tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Using action_ref in workflow_call contexts unavailable

The github.action_repository and github.action_ref context variables are not available in workflow_call contexts. These variables are only populated when steps use composite actions, not when workflows are called directly. This checkout step will fail with empty values. These workflows need either to be called as actions (not workflows) or use a different mechanism to obtain the correct ref.

Fix in Cursor Fix in Web

path: github-tools
repository: ${{ github.action_repository }}
ref: ${{ github.action_ref }}
path: ./.github-tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Using action_ref in workflow_call contexts unavailable

The github.action_repository and github.action_ref context variables are not available in workflow_call contexts. These variables are only populated when steps use composite actions, not when workflows are called directly. This checkout step will fail with empty values. These workflows need either to be called as actions (not workflows) or use a different mechanism to obtain the correct ref.

Fix in Cursor Fix in Web

path: github-tools
repository: ${{ github.action_repository }}
ref: ${{ github.action_ref }}
path: ./.github-tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Using action_ref in workflow_call contexts unavailable

The github.action_repository and github.action_ref context variables are not available in workflow_call contexts. These variables are only populated when steps use composite actions, not when workflows are called directly. This checkout step will fail with empty values when called via workflow_call. These workflows need either to be called as actions (not workflows) or use a different mechanism to obtain the correct ref.

Fix in Cursor Fix in Web

path: github-tools
repository: ${{ github.action_repository }}
ref: ${{ github.action_ref }}
path: ./.github-tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Using action_ref in workflow_call contexts unavailable

The github.action_repository and github.action_ref context variables are not available in workflow_call contexts. These variables are only populated when steps use composite actions, not when workflows are called directly. This checkout step will fail with empty values. These workflows need either to be called as actions (not workflows) or use a different mechanism to obtain the correct ref.

Fix in Cursor Fix in Web

path: github-tools
repository: ${{ github.action_repository }}
ref: ${{ github.action_ref }}
path: ./.github-tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: workflow_dispatch triggered workflow uses empty action context variables

The stable-sync workflow supports both workflow_dispatch and workflow_call triggers. When triggered via workflow_dispatch, github.action_repository and github.action_ref will be empty/null. This causes the checkout step to fail when someone manually triggers the workflow. These context variables are only available when a workflow is called as an action, not when manually dispatched.

Fix in Cursor Fix in Web

@Mrtenz Mrtenz marked this pull request as draft November 20, 2025 10:39
@Mrtenz
Copy link
Copy Markdown
Member Author

Mrtenz commented Nov 20, 2025

Need to rethink this.

@Mrtenz Mrtenz closed this Nov 20, 2025
@Mrtenz Mrtenz deleted the mrtenz/action-ref branch November 20, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants