Skip to content

Commit b2c5314

Browse files
authored
fix: metamaskbot comment nits (#29636)
<!-- 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** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29636?quickstart=1) This PR adds minor fixes and enhancements to things that were not worth blocking the original metamaskbot PR for. Things like, comments, style, reusability should be improved by this PR. Interestingly, I also saw that the `$OWNER` environment variable was missing, but somehow the workflow still worked. I added this environment variable just to make it sane. ## **Related issues** Fixes: #28572 ## **Manual testing steps** 1. Everything should still work ## **Screenshots/Recordings** Not applicable ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/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.
1 parent f58258b commit b2c5314

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

.github/workflows/publish-prerelease.yml

+16-13
Original file line numberDiff line numberDiff line change
@@ -25,41 +25,44 @@ jobs:
2525
BASE_REF: ${{ github.event.pull_request.base.ref }}
2626
run: |
2727
merge_base="$(git merge-base "origin/${BASE_REF}" HEAD)"
28-
echo "Merge base is '${merge_base}'"
2928
echo "MERGE_BASE=${merge_base}" >> "$GITHUB_OUTPUT"
29+
echo "Merge base is '${merge_base}'"
3030
3131
- name: Get CircleCI job details
3232
id: get-circleci-job-details
3333
env:
34-
REPOSITORY: ${{ github.repository }}
34+
OWNER: ${{ github.repository_owner }}
35+
REPOSITORY: ${{ github.event.repository.name }}
36+
# For a `pull_request` event, the branch is `github.head_ref``.
3537
BRANCH: ${{ github.head_ref }}
38+
# For a `pull_request` event, the head commit hash is `github.event.pull_request.head.sha`.
3639
HEAD_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
40+
JOB_NAME: job-publish-prerelease
3741
run: |
38-
pipeline_id=$(curl --silent "https://circleci.com/api/v2/project/gh/$OWNER/$REPOSITORY/pipeline?branch=$BRANCH" | jq -r ".items | map(select(.vcs.revision == \"${HEAD_COMMIT_HASH}\" )) | first | .id")
42+
pipeline_id=$(curl --silent "https://circleci.com/api/v2/project/gh/$OWNER/$REPOSITORY/pipeline?branch=$BRANCH" | jq --arg head_commit_hash "${HEAD_COMMIT_HASH}" -r '.items | map(select(.vcs.revision == $head_commit_hash)) | first | .id')
3943
workflow_id=$(curl --silent "https://circleci.com/api/v2/pipeline/$pipeline_id/workflow" | jq -r ".items[0].id")
40-
job_details=$(curl --silent "https://circleci.com/api/v2/workflow/$workflow_id/job" | jq -r '.items[] | select(.name == "job-publish-prerelease")')
41-
build_num=$(echo "$job_details" | jq -r '.job_number')
44+
job_details=$(curl --silent "https://circleci.com/api/v2/workflow/$workflow_id/job" | jq --arg job_name "${JOB_NAME}" -r '.items[] | select(.name == $job_name)')
4245
46+
build_num=$(echo "$job_details" | jq -r '.job_number')
4347
echo 'CIRCLE_BUILD_NUM='"$build_num" >> "$GITHUB_OUTPUT"
48+
4449
job_id=$(echo "$job_details" | jq -r '.id')
4550
echo 'CIRCLE_WORKFLOW_JOB_ID='"$job_id" >> "$GITHUB_OUTPUT"
4651
47-
echo "Getting artifacts from pipeline '${pipeline_id}', workflow '${workflow_id}', build number '${build_num}', job ID '${job_id}'"
52+
echo "Getting artifacts from pipeline '${pipeline_id}', workflow '${workflow_id}', build number '${build_num}', job id '${job_id}'"
4853
4954
- name: Get CircleCI job artifacts
5055
env:
5156
CIRCLE_WORKFLOW_JOB_ID: ${{ steps.get-circleci-job-details.outputs.CIRCLE_WORKFLOW_JOB_ID }}
5257
run: |
53-
mkdir -p "test-artifacts/chrome/benchmark"
58+
mkdir -p test-artifacts/chrome/benchmark
5459
curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/benchmark/pageload.json" > "test-artifacts/chrome/benchmark/pageload.json"
5560
56-
bundle_size=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/bundle_size.json")
57-
mkdir -p "test-artifacts/chrome"
58-
echo "${bundle_size}" > "test-artifacts/chrome/bundle_size.json"
61+
mkdir -p test-artifacts/chrome
62+
curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/bundle_size.json" > "test-artifacts/chrome/bundle_size.json"
5963
60-
stories=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/storybook/stories.json")
61-
mkdir "storybook-build"
62-
echo "${stories}" > "storybook-build/stories.json"
64+
mkdir storybook-build
65+
curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/storybook/stories.json" > "storybook-build/stories.json"
6366
6467
- name: Publish prerelease
6568
env:

0 commit comments

Comments
 (0)