Skip to content

Commit f90c2af

Browse files
authored
ci: Replace use of github-tools workflows with versioned actions (MetaMask#23799)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This replaces all use of `MetaMask/github-tools` _workflows_, usually referenced by a specific commit hash, with (composite) _actions_, referenced by a version. This has several benefits: - We can update actions used simply by creating a new release in the `github-tools` repository, propagating the changes to all repositories using the version. - Breaking changes can still be made by creating a major release. - Actions have access to certain variables that workflows don't have access to, letting us omit input options like `github-tools-ref`. - In cases where we're already running other steps, using an action avoids spinning up a new runner. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Replaces calls to MetaMask/github-tools reusable workflows with versioned composite actions (@v1) across CI/E2E/release/ops workflows, updating refs, steps, and required inputs. > > - **Workflows migrated from reusable workflows to versioned actions (`@v1`)**: > - `add-team-label`, `automated-rca` (adds `github-token`), `changelog-check`, `log-merge-group-failure`, `publish-slack-release-testing-status`, `remove-rca-needed-label-sheets`, `stale-issue-pr`, `stable-branch-sync`, `update-release-changelog`. > - Release PR workflows: `create-release-pr.yml` (switch to action `create-release-pr@v1`), `create-release-pr-legacy.yml` (adds explicit step with inputs/secrets via action). > - E2E build/test: `build-android-e2e.yml`, `build-ios-e2e.yml`, `run-e2e-workflow.yml`, `run-e2e-smoke-tests-android-flask.yml` (use `setup-e2e-env@v1`/`configure-keystore@v1`). > - **Ref updates/structural changes**: > - Replace pinned SHAs with `@v1`; add `runs-on` and explicit `steps` where needed; move secrets to action inputs (`with`) as required. > - Merge utilities: update `merge-stable-sync-pr.yml` and `merge-version-bump-pr.yml` refs to `merge-approved-pr@v1`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fae9f6e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent d1cb86c commit f90c2af

17 files changed

Lines changed: 103 additions & 77 deletions

.github/workflows/add-team-label.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ on:
77

88
jobs:
99
add-team-label:
10+
name: Add team label
1011
if: ${{ !github.event.pull_request.head.repo.fork }}
11-
uses: metamask/github-tools/.github/workflows/add-team-label.yml@7fe185fdb0e60981c898e88d82e44ff33f604daa
12-
secrets:
13-
TEAM_LABEL_TOKEN: ${{ secrets.TEAM_LABEL_TOKEN }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Add team label
15+
uses: MetaMask/github-tools/.github/actions/add-team-label@v1
16+
with:
17+
team-label-token: ${{ secrets.TEAM_LABEL_TOKEN }}

.github/workflows/automated-rca.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ permissions:
1010

1111
jobs:
1212
automated-rca:
13-
uses: MetaMask/github-tools/.github/workflows/post-gh-rca.yml@5da154078ddf6c022ed89dc3dbf378594afb8266
14-
with:
15-
repo-owner: ${{ github.repository_owner }}
16-
repo-name: ${{ github.event.repository.name }}
17-
issue-number: ${{ github.event.issue.number }}
18-
issue-labels: '["Sev0-urgent", "Sev1-high"]'
13+
name: Automated RCA
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Automated RCA
17+
uses: MetaMask/github-tools/.github/actions/post-gh-rca@v1
18+
with:
19+
repo-owner: ${{ github.repository_owner }}
20+
repo-name: ${{ github.event.repository.name }}
21+
issue-number: ${{ github.event.issue.number }}
22+
issue-labels: '["Sev0-urgent", "Sev1-high"]'
23+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build-android-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
echo "✅ System images installed"
5757
5858
- name: Setup Android Build Environment
59-
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@6742ebe1a3541cb13972d65352a0622a6a6677db
59+
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1
6060
with:
6161
platform: android
6262
setup-simulator: false

.github/workflows/build-ios-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767

6868
# Install Node.js, Xcode tools, and other iOS development dependencies
6969
- name: Installing iOS Environment Setup
70-
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@6742ebe1a3541cb13972d65352a0622a6a6677db
70+
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1
7171
with:
7272
platform: ios
7373
setup-simulator: false
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
name: ChangeLog Check
1+
name: Check Changelog
22

33
on:
44
pull_request:
55
types: [opened, synchronize, labeled, unlabeled]
66

77
jobs:
88
check-changelog:
9+
name: Check Changelog
10+
runs-on: ubuntu-latest
911
# Asking engineers to update CHANGELOG.md increases the potential for
1012
# conflicts across all pull requests.
1113
# Disable this workflow until we can refine the new changelog process.
1214
if: false
13-
14-
uses: MetaMask/github-tools/.github/workflows/changelog-check.yml@91e349d177db2c569e03c7aa69d2acb404b62f75
15-
with:
16-
base-branch: ${{ github.event.pull_request.base.ref }}
17-
head-ref: ${{ github.head_ref }}
18-
labels: ${{ toJSON(github.event.pull_request.labels) }}
19-
pr-number: ${{ github.event.pull_request.number }}
20-
repo: ${{ github.repository }}
21-
secrets:
22-
gh-token: ${{ secrets.PR_TOKEN }}
15+
steps:
16+
- name: Check changelog
17+
uses: MetaMask/github-tools/.github/actions/check-changelog@v1
18+
with:
19+
base-branch: ${{ github.event.pull_request.base.ref }}
20+
head-ref: ${{ github.head_ref }}
21+
labels: ${{ toJSON(github.event.pull_request.labels) }}
22+
pr-number: ${{ github.event.pull_request.number }}
23+
repo: ${{ github.repository }}

.github/workflows/ci.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,13 +576,16 @@ jobs:
576576
577577
log-merge-group-failure:
578578
name: Log merge group failure
579+
runs-on: ubuntu-latest
579580
# Only run this job if the merge group event fails, skip on forks
580581
if: ${{ github.event_name == 'merge_group' && failure() && !github.event.repository.fork }}
581582
needs:
582583
- check-all-jobs-pass
583-
uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@6bbad335a01fce1a9ec1eabd9515542c225d46c0
584-
secrets:
585-
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
586-
GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
587-
SPREADSHEET_ID: ${{ secrets.GOOGLE_MERGE_QUEUE_SPREADSHEET_ID }}
588-
SHEET_NAME: ${{ secrets.GOOGLE_MERGE_QUEUE_SHEET_NAME }}
584+
steps:
585+
- name: Log merge group failure to Google Sheets
586+
uses: MetaMask/github-tools/.github/actions/log-merge-group-failure@v1
587+
with:
588+
google-application-credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
589+
google-service-account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
590+
spreadsheet-id: ${{ secrets.GOOGLE_MERGE_QUEUE_SPREADSHEET_ID }}
591+
sheet-name: ${{ secrets.GOOGLE_MERGE_QUEUE_SHEET_NAME }}

.github/workflows/create-release-pr-legacy.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,24 @@ jobs:
1919
id-token: write
2020

2121
create-release-pr:
22+
name: Create release pull request
23+
runs-on: ubuntu-latest
2224
needs: generate-build-version
23-
uses: MetaMask/github-tools/.github/workflows/create-release-pr.yml@fc6fe1a3fb591f6afa61f0dbbe7698bd50fab9c7
24-
with:
25-
platform: mobile
26-
base-branch: ${{ inputs.base-branch }}
27-
semver-version: ${{ inputs.semver-version }}
28-
previous-version-tag: ${{ inputs.previous-version-tag }}
29-
mobile-build-version: ${{ needs.generate-build-version.outputs.build-version }}
30-
github-tools-version: fc6fe1a3fb591f6afa61f0dbbe7698bd50fab9c7
31-
32-
secrets:
33-
# This token needs read permissions to metamask-planning & write permissions to metamask-mobile
34-
github-token: ${{ secrets.PR_TOKEN }}
35-
google-application-creds-base64: ${{ secrets.GCP_RLS_SHEET_ACCOUNT_BASE64 }}
3625
permissions:
3726
contents: write
3827
pull-requests: write
28+
steps:
29+
- name: Create Release pull request
30+
uses: MetaMask/github-tools/.github/actions/create-release-pr@v1
31+
with:
32+
platform: mobile
33+
checkout-base-branch: ${{ inputs.base-branch }}
34+
release-pr-base-branch: ${{ inputs.base-branch }}
35+
semver-version: ${{ inputs.semver-version }}
36+
previous-version-ref: ${{ inputs.previous-version-tag }}
37+
mobile-build-version: ${{ needs.generate-build-version.outputs.build-version }}
38+
google-application-creds-base64: ${{ secrets.GCP_RLS_SHEET_ACCOUNT_BASE64 }}
39+
# This token needs read permissions to metamask-planning & write
40+
# permissions to metamask-mobile.
41+
github-token: ${{ secrets.PR_TOKEN }}
3942

.github/workflows/create-release-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
pull-requests: write
8686
steps:
8787
- name: Create Release PR
88-
uses: MetaMask/github-tools/.github/actions/create-release-pr@v1.1.2
88+
uses: MetaMask/github-tools/.github/actions/create-release-pr@v1
8989
with:
9090
platform: mobile
9191
checkout-base-branch: ${{ needs.resolve-bases.outputs.checkout_base }}

.github/workflows/merge-stable-sync-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
github.event.comment.author_association == 'MEMBER' ||
1616
github.event.comment.author_association == 'OWNER'
1717
)
18-
uses: MetaMask/github-tools/.github/workflows/merge-approved-pr.yml@7c0ab4db1e9c1d5673fe7958e8959f1842edbebd
18+
uses: MetaMask/github-tools/.github/workflows/merge-approved-pr.yml@v1
1919
with:
2020
pr-number: ${{ github.event.issue.number }}
2121
# Merge PRs from stable-main-X.Y.Z into main
2222
required-base-branch: 'main'
2323
head-branch-pattern: '^stable-main-[0-9]+\.[0-9]+\.[0-9]+$'
2424
secrets:
25-
github-token: ${{ secrets.METAMASK_MOBILE_BRANCH_SYNC_TOKEN }}
25+
github-token: ${{ secrets.METAMASK_MOBILE_BRANCH_SYNC_TOKEN }}

.github/workflows/merge-version-bump-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
github.event.comment.author_association == 'MEMBER' ||
1616
github.event.comment.author_association == 'OWNER'
1717
)
18-
uses: MetaMask/github-tools/.github/workflows/merge-approved-pr.yml@7c0ab4db1e9c1d5673fe7958e8959f1842edbebd
18+
uses: MetaMask/github-tools/.github/workflows/merge-approved-pr.yml@v1
1919
with:
2020
pr-number: ${{ github.event.issue.number }}
2121
# Merge PRs from version-bump/X.Y.Z into main
2222
required-base-branch: 'main'
2323
head-branch-pattern: '^version-bump/[0-9]+\.[0-9]+\.[0-9]+$'
2424
secrets:
25-
github-token: ${{ secrets.METAMASK_MOBILE_BRANCH_SYNC_TOKEN }}
25+
github-token: ${{ secrets.METAMASK_MOBILE_BRANCH_SYNC_TOKEN }}

0 commit comments

Comments
 (0)