Docs changes workflow #195
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: Branch Suggestion for PRs | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review, closed] | |
| workflow_call: | |
| secrets: | |
| JIRA_READ_AUTH: | |
| required: true | |
| description: 'Base64 encoded Jira email and scoped API token' | |
| JIRA_BASE_URL: | |
| required: true | |
| description: 'Scoped Jira API base URL, e.g. https://api.atlassian.com/ex/jira/<cloudId>' | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| jobs: | |
| suggest-branches: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout github-actions PR code | |
| if: github.repository == 'TykTechnologies/github-actions' && github.event_name == 'pull_request' | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Checkout github-actions main for external repos | |
| if: github.repository != 'TykTechnologies/github-actions' || github.event_name != 'pull_request' | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| repository: TykTechnologies/github-actions | |
| ref: main | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| working-directory: branch-suggestion | |
| run: npm install --ignore-scripts | |
| - name: Install Visor | |
| run: npm install -g @probelabs/visor@0.1.185 --ignore-scripts | |
| - name: Analyze PR and suggest branches | |
| working-directory: branch-suggestion | |
| env: | |
| VISOR_WORKSPACE_ENABLED: "false" | |
| JIRA_READ_AUTH: ${{ secrets.JIRA_READ_AUTH }} | |
| JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| PR_MERGED: ${{ github.event.pull_request.merged }} | |
| PR_ACTION: ${{ github.event.action }} | |
| REPOSITORY: ${{ github.repository }} | |
| BRANCH_NAME: ${{ github.head_ref }} | |
| run: | | |
| visor --config branch_suggestion.yml --debug --tags remote |