Fix siteComponent!! crash on the dashboard
#551
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto-merge Dependabot PATCH updates | |
| on: | |
| pull_request: | |
| types: [opened, reopened] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| auto-merge: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'woocommerce/woocommerce-android' | |
| env: | |
| PR_URL: ${{ github.event.pull_request.html_url }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Fetch Dependabot metadata | |
| id: metadata | |
| uses: dependabot/fetch-metadata@v2 | |
| with: | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Assign closest open milestone to PR | |
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | |
| run: | | |
| set -e | |
| title=$(gh api repos/$GITHUB_REPOSITORY/milestones \ | |
| --jq '[.[] | |
| | select(.state=="open" and .due_on!=null and (.due_on | fromdateiso8601) >= now) | |
| ] | |
| | sort_by(.due_on) | |
| | .[0].title') | |
| if [ -n "$title" ]; then | |
| echo "Assigning milestone '$title' to PR #${{ github.event.pull_request.number }}" | |
| gh pr edit "${{ github.event.pull_request.number }}" --milestone "$title" | |
| else | |
| echo "No future open milestones found." | |
| fi | |
| - name: Approve the PR | |
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | |
| run: | | |
| set -e | |
| gh pr review --approve "$PR_URL" | |
| - name: Enable auto-merge for Dependabot PRs | |
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | |
| run: | | |
| set -e | |
| gh pr merge --auto --merge "$PR_URL" |