From 3a6d55d0b37fc632bf9f0f2a88dd4cf3e3a8ad37 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Thu, 6 Feb 2025 17:10:54 +0100 Subject: [PATCH] chore: align with PR comments --- ...te-wordpress-js-dependencies-orchestrator.yml | 14 +++++++------- .../update-wordpress-js-dependencies.yml | 12 ++++++------ docs/update-wp-dependencies.md | 16 ++++++++-------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/update-wordpress-js-dependencies-orchestrator.yml b/.github/workflows/update-wordpress-js-dependencies-orchestrator.yml index 2c2c1b29..47a56b4d 100644 --- a/.github/workflows/update-wordpress-js-dependencies-orchestrator.yml +++ b/.github/workflows/update-wordpress-js-dependencies-orchestrator.yml @@ -2,7 +2,7 @@ name: Update WordPress JS Dependencies Orchestrator on: workflow_call: inputs: - WP_SCRIPT_DIST_TAG: + WP_DIST_TAG: description: The dist-tag to update the dependencies to, e.g., `wp-6.7` required: true type: string @@ -11,8 +11,8 @@ on: required: false type: string secrets: - GH_API_TOKEN: - description: An GH API Token capable of triggering repository_dispatch. + GH_TOKEN: + description: A personal access token (classic) with `repo` and `workflow` permissions, used to authenticate when calling GitHub APIs in target repositories. required: true jobs: @@ -20,8 +20,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 env: - GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }} - WP_SCRIPT_DIST_TAG: ${{ inputs.WP_SCRIPT_DIST_TAG }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} + WP_DIST_TAG: ${{ inputs.WP_DIST_TAG }} PACKAGES: ${{ inputs.PACKAGES }} steps: @@ -57,8 +57,8 @@ jobs: curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ env.GH_API_TOKEN }}" \ + -H "Authorization: Bearer ${{ env.GH_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/$package/dispatches \ - -d '{"event_type":"update_wp_dependencies","client_payload":{"wp_version":"${{ env.WP_SCRIPT_DIST_TAG }}"}}' + -d '{"event_type":"update_wp_dependencies","client_payload":{"wp_version":"${{ env.WP_DIST_TAG }}"}}' done \ No newline at end of file diff --git a/.github/workflows/update-wordpress-js-dependencies.yml b/.github/workflows/update-wordpress-js-dependencies.yml index 2d091182..f1bf4217 100644 --- a/.github/workflows/update-wordpress-js-dependencies.yml +++ b/.github/workflows/update-wordpress-js-dependencies.yml @@ -2,7 +2,7 @@ name: Update WordPress JS Dependencies on: workflow_call: inputs: - WP_SCRIPT_DIST_TAG: + WP_DIST_TAG: description: The dist-tag to update the dependencies to, e.g., `wp-6.7` required: true type: string @@ -38,7 +38,7 @@ jobs: GITHUB_USER_NAME: ${{ secrets.GITHUB_USER_NAME }} GITHUB_USER_SSH_KEY: ${{ secrets.GITHUB_USER_SSH_KEY }} GITHUB_USER_SSH_PUBLIC_KEY: ${{ secrets.GITHUB_USER_SSH_PUBLIC_KEY }} - WP_SCRIPT_DIST_TAG: ${{ github.event.client_payload.wp_version || inputs.WP_SCRIPT_DIST_TAG }} + WP_DIST_TAG: ${{ github.event.client_payload.wp_version || inputs.WP_DIST_TAG }} NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} NPM_REGISTRY_DOMAIN: ${{ inputs.NPM_REGISTRY_DOMAIN }} @@ -51,7 +51,7 @@ jobs: - name: Set global variables run: | - echo "TEMP_BRANCH_NAME=update/${{ env.WP_SCRIPT_DIST_TAG }}" >> $GITHUB_ENV + echo "TEMP_BRANCH_NAME=update/${{ env.WP_DIST_TAG }}" >> $GITHUB_ENV echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: Set up SSH @@ -106,7 +106,7 @@ jobs: env: SCRIPT_START: ${{ env.PACKAGE_MANAGER == 'npm' && 'npm run' }} run: | - ./node_modules/.bin/wp-scripts packages-update --dist-tag=${{ env.WP_SCRIPT_DIST_TAG }} + ./node_modules/.bin/wp-scripts packages-update --dist-tag=${{ env.WP_DIST_TAG }} - name: Git add, commit run: | @@ -124,8 +124,8 @@ jobs: gh pr create \ --base ${{ github.event.repository.default_branch }} \ --head ${{ env.TEMP_BRANCH_NAME }} \ - --title "Align WP Dependencies to meet dist tag ${{ env.WP_SCRIPT_DIST_TAG }} - ${{ env.CURRENT_DATE }}" \ - --body "This PR updates the WordPress dependencies to meet the version ${{ env.WP_SCRIPT_DIST_TAG }}." \ + --title "Align WP Dependencies to meet dist tag ${{ env.WP_DIST_TAG }} - ${{ env.CURRENT_DATE }}" \ + --body "This PR updates the WordPress dependencies to meet the version ${{ env.WP_DIST_TAG }}." \ --label "dependencies" - name: Delete signing key files diff --git a/docs/update-wp-dependencies.md b/docs/update-wp-dependencies.md index c964ccd8..62582733 100644 --- a/docs/update-wp-dependencies.md +++ b/docs/update-wp-dependencies.md @@ -30,7 +30,7 @@ WordPress version tag (e.g., `wp-6.7`) and creates a pull request containing all | Name | Default | Description | |-----------------------|---------------------------------|-------------------------------------------------------| -| `WP_VERSION` | `'wp-6.7'` | The tag to update the dependencies to, e.g., `wp-6.7` | +| `WP_DIST_TAG` | `'wp-6.7'` | The tag to update the dependencies to, e.g., `wp-6.7` | | `NPM_REGISTRY_DOMAIN` | `'https://npm.pkg.github.com/'` | Domain of the private npm registry | #### Secrets @@ -51,7 +51,7 @@ name: Update WordPress JS Dependencies on: workflow_dispatch: inputs: - WP_VERSION: + WP_DIST_TAG: description: 'The tag to update the dependencies to, e.g., `wp-6.7`.' default: 'wp-6.7' required: true @@ -69,7 +69,7 @@ jobs: GITHUB_USER_SSH_PUBLIC_KEY: ${{ secrets.DEPLOYBOT_SSH_PUBLIC_KEY }} NPM_REGISTRY_TOKEN: ${{ secrets.DEPLOYBOT_PACKAGES_READ_ACCESS_TOKEN }} with: - WP_VERSION: ${{ inputs.WP_VERSION }} + WP_DIST_TAG: ${{ inputs.WP_DIST_TAG }} ``` ## Update WordPress JS Dependencies Orchestrator Workflow @@ -84,14 +84,14 @@ maintain a centralized list of repositories needing consistent WordPress JS depe | Name | Default | Description | |--------------|------------|----------------------------------------------------------------| -| `WP_VERSION` | `'wp-6.7'` | The tag to update the dependencies to, e.g., `wp-6.7` | +| `WP_DIST_TAG` | `'wp-6.7'` | The tag to update the dependencies to, e.g., `wp-6.7` | | `PACKAGES` | `''` | Comma-separated list of additional `owner/repo`s to be updated | #### Secrets | Name | Description | |----------------|-------------------------------------------------------------------------------------------------------------------------| -| `GH_API_TOKEN` | A personal access token (classic) with `repo` and `workflow` permissions, used to authenticate when calling GitHub APIs | +| `GH_TOKEN` | A personal access token (classic) with `repo` and `workflow` permissions, used to authenticate when calling GitHub APIs | ### Usage example @@ -101,7 +101,7 @@ name: Update WordPress JS Dependencies Orchestrator on: workflow_dispatch: inputs: - WP_VERSION: + WP_DIST_TAG: description: 'The tag to update the dependencies to, e.g., `wp-6.7`' required: true PACKAGES: @@ -113,8 +113,8 @@ jobs: update-dependency-orchestrator: uses: inpsyde/reusable-workflows/.github/workflows/update-wordpress-js-dependencies-orchestrator.yml@main with: - WP_VERSION: ${{ inputs.WP_VERSION }} + WP_DIST_TAG: ${{ inputs.WP_DIST_TAG }} PACKAGES: ${{ inputs.PACKAGES }} secrets: - GH_API_TOKEN: ${{ secrets.DEPLOYBOT_REPO_READ_WRITE_TOKEN }} + GH_TOKEN: ${{ secrets.DEPLOYBOT_REPO_READ_WRITE_TOKEN }} ```