-
-
Notifications
You must be signed in to change notification settings - Fork 5
chore!: Checkout action using action_ref
#163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| name: Check Changelog | ||
|
|
||
| inputs: | ||
| base-branch: | ||
| description: 'The base branch to compare against' | ||
| required: false | ||
| default: 'main' | ||
| head-ref: | ||
| description: 'The head ref to check out' | ||
| required: true | ||
| labels: | ||
| description: 'JSON string of PR labels' | ||
| required: true | ||
| pr-number: | ||
| description: 'The pull request number' | ||
| required: true | ||
| repo: | ||
| description: 'The repository to check' | ||
| required: true | ||
| github-tools-repository: | ||
| description: 'The GitHub repository containing the GitHub tools' | ||
| required: false | ||
| default: ${{ github.action_repository }} | ||
| github-tools-ref: | ||
| description: 'The SHA of the action to use' | ||
| required: false | ||
| default: ${{ github.action_ref }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Check PR Labels | ||
| id: label-check | ||
| env: | ||
| PR_LABELS: ${{ inputs.labels }} | ||
| run: | | ||
| if echo "$PR_LABELS" | jq -e '.[] | select(.name == "no-changelog")' > /dev/null; then | ||
| echo "no-changelog label found, skipping changelog check." | ||
| echo "skip_check=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "No no-changelog label found, proceeding with check." | ||
| echo "skip_check=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| shell: bash | ||
|
|
||
| - name: Check out target repository | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: ${{ inputs.repo }} | ||
| ref: ${{ inputs.head-ref }} | ||
| path: target-repo | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Debug log | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| env: | ||
| ACTION_REPOSITORY: ${{ inputs.github-tools-repository }} | ||
| ACTION_REF: ${{ inputs.github-tools-ref }} | ||
| run: | | ||
| echo "ACTION_REPOSITORY: $ACTION_REPOSITORY" | ||
| echo "ACTION_REF: $ACTION_REF" | ||
| shell: bash | ||
|
|
||
| - name: Checkout GitHub tools repository | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| repository: ${{ inputs.github-tools-repository }} | ||
| ref: ${{ inputs.github-tools-ref }} | ||
| path: ./.github-tools | ||
|
|
||
| - name: Enable Corepack | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| run: corepack enable | ||
| shell: bash | ||
| working-directory: ./.github-tools | ||
|
|
||
| - name: Set up Node.js | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: ./.github-tools/.nvmrc | ||
| cache-dependency-path: ./.github-tools/yarn.lock | ||
| cache: yarn | ||
|
|
||
| - name: Install dependencies | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| run: yarn --immutable | ||
| shell: bash | ||
| working-directory: ./.github-tools | ||
|
|
||
| - name: Check Changelog | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| id: changelog-check | ||
| shell: bash | ||
| working-directory: ./.github-tools | ||
| env: | ||
| BASE_BRANCH: ${{ inputs.base-branch }} | ||
| PR_NUMBER: ${{ inputs.pr-number }} | ||
| run: | | ||
| yarn run changelog:check ../target-repo "$BASE_BRANCH" "$PR_NUMBER" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,13 +56,13 @@ jobs: | |
| path: target-repo | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Checkout github-tools repository | ||
| - name: Checkout GitHub tools repository | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| repository: MetaMask/github-tools | ||
| ref: ${{ inputs.action-sha }} | ||
| path: github-tools | ||
| repository: ${{ github.action_repository }} | ||
| ref: ${{ github.action_ref }} | ||
| path: ./.github-tools | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Using action_ref in workflow_call contexts unavailableThe |
||
|
|
||
| - name: Enable Corepack | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
|
|
@@ -73,21 +73,21 @@ jobs: | |
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: ./github-tools/.nvmrc | ||
| cache-dependency-path: ./github-tools/yarn.lock | ||
| node-version-file: ./.github-tools/.nvmrc | ||
| cache-dependency-path: ./.github-tools/yarn.lock | ||
| cache: yarn | ||
|
|
||
| - name: Install dependencies | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| run: yarn --immutable | ||
| shell: bash | ||
| working-directory: ./github-tools | ||
| working-directory: ./.github-tools | ||
|
|
||
| - name: Check Changelog | ||
| if: ${{ steps.label-check.outputs.skip_check != 'true' }} | ||
| id: changelog-check | ||
| shell: bash | ||
| working-directory: ./github-tools | ||
| working-directory: ./.github-tools | ||
| env: | ||
| BASE_BRANCH: ${{ inputs.base-branch || 'main' }} | ||
| PR_NUMBER: ${{ inputs.pr-number }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,10 +49,6 @@ on: | |
| required: true | ||
| type: string | ||
| description: 'The platform for which the release PR is being created.' | ||
| github-tools-version: | ||
| type: string | ||
| description: 'The version of github-tools to use. Defaults to main.' | ||
| default: 'main' | ||
| git-user-name: | ||
| type: string | ||
| description: 'Git user name for commits. Defaults to metamaskbot.' | ||
|
|
@@ -86,16 +82,16 @@ jobs: | |
| token: ${{ secrets.github-token }} | ||
|
|
||
| # Step 2: Checkout github-tools repository | ||
| - name: Checkout github-tools repository | ||
| uses: actions/checkout@v4 | ||
| - name: Checkout GitHub tools repository | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| repository: MetaMask/github-tools | ||
| ref: ${{ inputs.github-tools-version }} | ||
| path: github-tools | ||
| repository: ${{ github.action_repository }} | ||
| ref: ${{ github.action_ref }} | ||
| path: ./.github-tools | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Using action_ref in workflow_call contexts unavailableThe |
||
|
|
||
| # Step 3: Setup environment from github-tools | ||
| - name: Checkout and setup environment | ||
| uses: ./github-tools/.github/actions/checkout-and-setup | ||
| uses: ./.github-tools/.github/actions/checkout-and-setup | ||
| with: | ||
| is-high-risk-environment: true | ||
|
|
||
|
|
@@ -112,7 +108,6 @@ jobs: | |
| MOBILE_TEMPLATE_SHEET_ID: ${{ inputs.mobile-template-sheet-id }} | ||
| EXTENSION_TEMPLATE_SHEET_ID: ${{ inputs.extension-template-sheet-id }} | ||
| RELEASE_SHEET_GOOGLE_DOCUMENT_ID: ${{ inputs.release-sheet-google-document-id }} | ||
| GITHUB_TOOLS_VERSION: ${{ inputs.github-tools-version }} | ||
| GIT_USER_NAME: ${{ inputs.git-user-name }} | ||
| GIT_USER_EMAIL: ${{ inputs.git-user-email }} | ||
| run: | | ||
|
|
@@ -130,7 +125,6 @@ jobs: | |
| echo "Mobile Template Sheet ID: $MOBILE_TEMPLATE_SHEET_ID" | ||
| echo "Extension Template Sheet ID: $EXTENSION_TEMPLATE_SHEET_ID" | ||
| echo "Release Sheet Google Document ID: $RELEASE_SHEET_GOOGLE_DOCUMENT_ID" | ||
| echo "GitHub Tools Version: $GITHUB_TOOLS_VERSION" | ||
| echo "Git User Name: $GIT_USER_NAME" | ||
| echo "Git User Email: $GIT_USER_EMAIL" | ||
| echo "-------------" | ||
|
|
@@ -158,7 +152,7 @@ jobs: | |
| working-directory: ${{ github.workspace }} | ||
| run: | | ||
| # Execute the script from github-tools | ||
| ./github-tools/.github/scripts/create-platform-release-pr.sh \ | ||
| ./.github-tools/.github/scripts/create-platform-release-pr.sh \ | ||
| "$PLATFORM" \ | ||
| "$PREVIOUS_VERSION_REF" \ | ||
| "$SEMVER_VERSION" \ | ||
|
|
||
There was a problem hiding this comment.
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-toolsby commit.