fix: add fallback extraction for classify-issue-severity workflow #8023
Workflow file for this run
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: dependabot | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| permissions: | |
| contents: read | |
| jobs: | |
| dependabot-automerge: | |
| runs-on: ubuntu-latest | |
| if: > | |
| github.event_name == 'pull_request' && | |
| github.event.action == 'opened' && | |
| github.event.pull_request.user.login == 'dependabot[bot]' && | |
| github.event.pull_request.user.id == 49699333 && | |
| github.repository == 'coder/coder' | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - name: Dependabot metadata | |
| id: metadata | |
| uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0 | |
| with: | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Approve the PR | |
| if: steps.metadata.outputs.package-ecosystem != 'github-actions' | |
| run: | | |
| echo "Approving $PR_URL" | |
| gh pr review --approve "$PR_URL" | |
| env: | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Enable auto-merge | |
| if: steps.metadata.outputs.package-ecosystem != 'github-actions' | |
| run: | | |
| echo "Enabling auto-merge for $PR_URL" | |
| gh pr merge --auto --squash "$PR_URL" | |
| env: | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Send Slack notification | |
| run: | | |
| if [ "$PACKAGE_ECOSYSTEM" = "github-actions" ]; then | |
| STATUS_TEXT=":pr-opened: Dependabot opened PR #${PR_NUMBER} (GitHub Actions changes are not auto-merged)" | |
| else | |
| STATUS_TEXT=":pr-merged: Auto merge enabled for Dependabot PR #${PR_NUMBER}" | |
| fi | |
| curl -X POST -H 'Content-type: application/json' \ | |
| --data '{ | |
| "username": "dependabot", | |
| "icon_url": "https://avatars.githubusercontent.com/u/27347476", | |
| "blocks": [ | |
| { | |
| "type": "header", | |
| "text": { | |
| "type": "plain_text", | |
| "text": "'"${STATUS_TEXT}"'", | |
| "emoji": true | |
| } | |
| }, | |
| { | |
| "type": "section", | |
| "fields": [ | |
| { | |
| "type": "mrkdwn", | |
| "text": "'"${PR_TITLE}"'" | |
| } | |
| ] | |
| }, | |
| { | |
| "type": "actions", | |
| "elements": [ | |
| { | |
| "type": "button", | |
| "text": { | |
| "type": "plain_text", | |
| "text": "View PR" | |
| }, | |
| "url": "'"${PR_URL}"'" | |
| } | |
| ] | |
| } | |
| ] | |
| }' "${{ secrets.DEPENDABOT_PRS_SLACK_WEBHOOK }}" | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.DEPENDABOT_PRS_SLACK_WEBHOOK }} | |
| PACKAGE_ECOSYSTEM: ${{ steps.metadata.outputs.package-ecosystem }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| PR_URL: ${{ github.event.pull_request.html_url }} |